<?php
namespace CoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use UserBundle\Entity\User;
/**
* link the response to the student and session
* @ORM\Table("textbook_session_response")
* @ORM\Entity(repositoryClass="CoreBundle\Entity\TextbookSessionResponseRepository")
*/
class TextbookSessionResponse
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="UserBundle\Entity\User")
* @ORM\JoinColumn(name="student", referencedColumnName="id")
*/
private $student;
/**
* @var TextbookSession
*
* @ORM\ManyToOne(targetEntity="CoreBundle\Entity\TextbookSession")
* @ORM\JoinColumn(name="textbook_session", referencedColumnName="id", onDelete="CASCADE")
*/
private $textbookSession;
/**
* @var TextbookSubTopic
*
* @ORM\ManyToOne(targetEntity="CoreBundle\Entity\TextbookSubTopic")
* @ORM\JoinColumn(name="textbook_sub_topic", referencedColumnName="id", onDelete="CASCADE")
*/
private $textbookSubTopic;
/**
* @var TextbookSubTopicQuestion
*
* @ORM\ManyToOne(targetEntity="CoreBundle\Entity\TextbookSubTopicQuestion")
* @ORM\JoinColumn(name="question", referencedColumnName="id", onDelete="CASCADE")
*/
private $textbookSubTopicQuestion;
/**
* @var TextbookSubTopicAnswer
*
* @ORM\ManyToOne(targetEntity="CoreBundle\Entity\TextbookSubTopicAnswer")
* @ORM\JoinColumn(name="answer_chosen", referencedColumnName="id", onDelete="CASCADE")
*/
private $answerChosen;
/**
* @var bool
*
* @ORM\Column(name="is_valid", type="boolean", nullable=true, options={"default":true})
*/
private $isValid = true;
/**
* @var \DateTime
*
* @ORM\Column(name="archived_at", type="datetime", nullable=true)
*/
private $archivedAt;
public function __construct($student, $textbookSession, $textbookSubTopic, $textbookSubTopicQuestion, $answerChosen)
{
$this->student = $student;
$this->textbookSession = $textbookSession;
$this->textbookSubTopic = $textbookSubTopic;
$this->textbookSubTopicQuestion = $textbookSubTopicQuestion;
$this->answerChosen = $answerChosen;
}
/**
* @return User
*/
public function getStudent()
{
return $this->student;
}
/**
* @param User $student
*/
public function setStudent($student)
{
$this->student = $student;
}
/**
* @return TextbookSession
*/
public function getSession()
{
return $this->textbookSession;
}
/**
* @param TextbookSession $session
*/
public function setSession($session)
{
$this->textbookSession = $session;
}
/**
* @return TextbookSubTopicQuestion
*/
public function getQuestion()
{
return $this->textbookSubTopicQuestion;
}
/**
* @param TextbookSubTopicQuestion $question
*/
public function setQuestion($question)
{
$this->textbookSubTopicQuestion = $question;
}
/**
* @return TextbookSubTopicAnswer
*/
public function getAnswerChosen()
{
return $this->answerChosen;
}
/**
* @param TextbookSubTopicAnswer $answerChosen
*/
public function setAnswerChosen($answerChosen)
{
$this->answerChosen = $answerChosen;
}
/**
* @return TextbookSubTopic
*/
public function getTextbookSubTopic(): TextbookSubTopic
{
return $this->textbookSubTopic;
}
/**
* @return bool
*/
public function isValid(): bool
{
return $this->isValid;
}
/**
* @param bool $isValid
*/
public function setIsValid(bool $isValid): void
{
$this->isValid = $isValid;
}
/**
* @return \DateTime|null
*/
public function getArchivedAt(): ?\DateTime
{
return $this->archivedAt;
}
/**
* @param \DateTime $archivedAt
*/
public function setArchivedAt(\DateTime $archivedAt): void
{
$this->archivedAt = $archivedAt;
}
}