<?php
namespace CoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use UserBundle\Entity\User;
/**
* @ORM\Table("textbook_session_comprehension")
* @ORM\Entity(repositoryClass="TextbookSessionComprehensionRepository")
*/
class TextbookSessionComprehension
{
/**
* @var int
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="UserBundle\Entity\User")
* @ORM\JoinColumn(name="student", nullable=false)
*/
private $student;
/**
* @var TextbookSession
*
* @ORM\ManyToOne(targetEntity="CoreBundle\Entity\TextbookSession")
* @ORM\JoinColumn(name="textbook_session", nullable=false)
*/
private $textbookSession;
/**
* @var TextbookSubTopic
*
* @ORM\ManyToOne(targetEntity="CoreBundle\Entity\TextbookSubTopic")
* @ORM\JoinColumn(name="textbook_sub_topic", nullable=false)
*/
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;
}
/**
* @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;
}
}