src/Entity/Core/Textbook/TextbookSessionComprehension.php line 12

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