src/CoreBundle/Entity/TextbookSessionComprehension.php line 13

Open in your IDE?
  1. <?php
  2. namespace CoreBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use UserBundle\Entity\User;
  5. /**
  6. * @ORM\Table("textbook_session_comprehension")
  7. * @ORM\Entity(repositoryClass="TextbookSessionComprehensionRepository")
  8. */
  9. class TextbookSessionComprehension
  10. {
  11. /**
  12. * @var int
  13. *
  14. * @ORM\Id
  15. * @ORM\Column(name="id", type="integer")
  16. * @ORM\GeneratedValue(strategy="AUTO")
  17. */
  18. private $id;
  19. /**
  20. * @var User
  21. *
  22. * @ORM\ManyToOne(targetEntity="UserBundle\Entity\User")
  23. * @ORM\JoinColumn(name="student", nullable=false)
  24. */
  25. private $student;
  26. /**
  27. * @var TextbookSession
  28. *
  29. * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\TextbookSession")
  30. * @ORM\JoinColumn(name="textbook_session", nullable=false)
  31. */
  32. private $textbookSession;
  33. /**
  34. * @var TextbookSubTopic
  35. *
  36. * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\TextbookSubTopic")
  37. * @ORM\JoinColumn(name="textbook_sub_topic", nullable=false)
  38. */
  39. private $textbookSubTopic;
  40. /**
  41. * @var int
  42. *
  43. * The level of comprehension ranging from 1 to 3: 1 is worst, 3 is best.
  44. *
  45. * @ORM\Column(name="level", type="smallint", nullable=false)
  46. */
  47. private $level;
  48. /**
  49. * @var bool
  50. *
  51. * @ORM\Column(name="is_valid", type="boolean", nullable=true, options={"default":true})
  52. */
  53. private $isValid = true;
  54. /**
  55. * @var \DateTime
  56. *
  57. * @ORM\Column(name="archived_at", type="datetime", nullable=true)
  58. */
  59. private $archivedAt;
  60. public function __construct($student, $textbookSession, $textbookSubTopic, $level)
  61. {
  62. $this->student = $student;
  63. $this->textbookSession = $textbookSession;
  64. $this->textbookSubTopic = $textbookSubTopic;
  65. $this->level = $level;
  66. }
  67. public function getLevel(): int
  68. {
  69. return $this->level;
  70. }
  71. public function getTextbookSubTopic(): TextbookSubTopic
  72. {
  73. return $this->textbookSubTopic;
  74. }
  75. /**
  76. * @return bool
  77. */
  78. public function isValid(): bool
  79. {
  80. return $this->isValid;
  81. }
  82. /**
  83. * @param bool $isValid
  84. */
  85. public function setIsValid(bool $isValid): void
  86. {
  87. $this->isValid = $isValid;
  88. }
  89. /**
  90. * @return \DateTime|null
  91. */
  92. public function getArchivedAt(): ?\DateTime
  93. {
  94. return $this->archivedAt;
  95. }
  96. /**
  97. * @param \DateTime $archivedAt
  98. */
  99. public function setArchivedAt(\DateTime $archivedAt): void
  100. {
  101. $this->archivedAt = $archivedAt;
  102. }
  103. }