<?php
namespace App\Entity\Core\Textbook;
use App\Entity\User\User;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
/**
* link the response to the student and session
*/
#[ORM\Table('textbook_session_response')]
#[ORM\Entity(repositoryClass: TextbookSessionResponseRepository::class)]
class TextbookSessionResponse
{
/**
* @var int
*/
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;
/**
* @var User
*/
#[ORM\JoinColumn(name: 'student', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: User::class)]
private $student;
/**
* @var TextbookSession
*/
#[ORM\JoinColumn(name: 'textbook_session', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\ManyToOne(targetEntity: TextbookSession::class)]
private $textbookSession;
/**
* @var TextbookSubTopic
*/
#[ORM\JoinColumn(name: 'textbook_sub_topic', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\ManyToOne(targetEntity: TextbookSubTopic::class)]
private $textbookSubTopic;
/**
* @var TextbookSubTopicQuestion
*/
#[ORM\JoinColumn(name: 'question', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\ManyToOne(targetEntity: TextbookSubTopicQuestion::class)]
private $textbookSubTopicQuestion;
/**
* @var TextbookSubTopicAnswer
*/
#[ORM\JoinColumn(name: 'answer_chosen', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\ManyToOne(targetEntity: TextbookSubTopicAnswer::class)]
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;
}
public function getTextbookSubTopic(): TextbookSubTopic
{
return $this->textbookSubTopic;
}
public function isValid(): bool
{
return $this->isValid;
}
public function setIsValid(bool $isValid): void
{
$this->isValid = $isValid;
}
public function getArchivedAt(): ?DateTime
{
return $this->archivedAt;
}
public function setArchivedAt(DateTime $archivedAt): void
{
$this->archivedAt = $archivedAt;
}
}