<?php
namespace App\Entity\Core\Textbook;
use App\Entity\User\User;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table('textbook_session_comprehension')]
#[ORM\Entity(repositoryClass: TextbookSessionComprehensionRepository::class)]
class TextbookSessionComprehension
{
/**
* @var int
*/
#[ORM\Id]
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;
/**
* @var User
*/
#[ORM\JoinColumn(name: 'student', nullable: false)]
#[ORM\ManyToOne(targetEntity: User::class)]
private $student;
/**
* @var TextbookSession
*/
#[ORM\JoinColumn(name: 'textbook_session', nullable: false)]
#[ORM\ManyToOne(targetEntity: TextbookSession::class)]
private $textbookSession;
/**
* @var TextbookSubTopic
*/
#[ORM\JoinColumn(name: 'textbook_sub_topic', nullable: false)]
#[ORM\ManyToOne(targetEntity: TextbookSubTopic::class)]
private $textbookSubTopic;
/**
* @var int
*
* The level of comprehension ranging from 1 to 3: 1 is worst, 3 is best.
*/
#[ORM\Column(name: 'level', type: 'smallint', nullable: false)]
private $level;
/**
* @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, $level)
{
$this->student = $student;
$this->textbookSession = $textbookSession;
$this->textbookSubTopic = $textbookSubTopic;
$this->level = $level;
}
public function getLevel(): int
{
return $this->level;
}
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;
}
}