src/Entity/Core/ReadingTest/ReadingTestUnit.php line 14

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\Core\ReadingTest;
  4. use App\Entity\User\User;
  5. use DateTime;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Table('reading_test_unit')]
  8. #[ORM\Entity(repositoryClass: ReadingTestUnitRepository::class)]
  9. class ReadingTestUnit
  10. {
  11. /**
  12. * @var int
  13. */
  14. #[ORM\Column(name: 'id', type: 'integer')]
  15. #[ORM\Id]
  16. #[ORM\GeneratedValue(strategy: 'AUTO')]
  17. private $id;
  18. /**
  19. * @var ReadingTestSession
  20. */
  21. #[ORM\JoinColumn(name: 'reading_test_session', referencedColumnName: 'id', onDelete: 'CASCADE')]
  22. #[ORM\ManyToOne(targetEntity: ReadingTestSession::class, inversedBy: 'readingTestUnits')]
  23. private $readingTestSession;
  24. /**
  25. * @var User
  26. */
  27. #[ORM\JoinColumn(name: 'student', referencedColumnName: 'id')]
  28. #[ORM\ManyToOne(targetEntity: User::class)]
  29. private $student;
  30. /**
  31. * @var DateTime
  32. */
  33. #[ORM\Column(name: 'deadline', type: 'datetime', nullable: true)]
  34. private $deadline;
  35. /**
  36. * @var bool
  37. */
  38. #[ORM\Column(name: 'finished', type: 'boolean', options: ['default' => false])]
  39. private $finished;
  40. /**
  41. * @var DateTime
  42. */
  43. #[ORM\Column(name: 'reading_start_time', type: 'datetime', nullable: true)]
  44. private $readingStartTime;
  45. /**
  46. * @var DateTime
  47. */
  48. #[ORM\Column(name: 'reading_stop_time', type: 'datetime', nullable: true)]
  49. private $readingStopTime;
  50. /**
  51. * @var float
  52. */
  53. #[ORM\Column(name: 'words_per_minute', type: 'float', nullable: true)]
  54. private $wordsPerMinute;
  55. /**
  56. * @var ReadingTestResponse[]
  57. */
  58. #[ORM\OneToMany(targetEntity: ReadingTestResponse::class, mappedBy: 'readingTestUnit', cascade: ['persist'])]
  59. private $readingTestResponses;
  60. /**
  61. * @var DateTime
  62. */
  63. #[ORM\Column(name: 'extended_deadline', type: 'datetime', nullable: true)]
  64. private $extendedDeadline;
  65. public function getId(): int
  66. {
  67. return $this->id;
  68. }
  69. public function setId(int $id): void
  70. {
  71. $this->id = $id;
  72. }
  73. public function getReadingTestSession(): ReadingTestSession
  74. {
  75. return $this->readingTestSession;
  76. }
  77. public function setReadingTestSession(ReadingTestSession $readingTestSession): void
  78. {
  79. $this->readingTestSession = $readingTestSession;
  80. }
  81. public function getStudent(): User
  82. {
  83. return $this->student;
  84. }
  85. public function setStudent(User $student): void
  86. {
  87. $this->student = $student;
  88. }
  89. /**
  90. * @return DateTime
  91. */
  92. public function getDeadline(): ?DateTime
  93. {
  94. return $this->deadline;
  95. }
  96. /**
  97. * @param DateTime $deadline
  98. */
  99. public function setDeadline(?DateTime $deadline): void
  100. {
  101. $this->deadline = $deadline;
  102. }
  103. public function isFinished(): bool
  104. {
  105. return $this->finished;
  106. }
  107. public function setFinished(bool $finished): void
  108. {
  109. $this->finished = $finished;
  110. }
  111. /**
  112. * @return DateTime
  113. */
  114. public function getReadingStartTime(): ?DateTime
  115. {
  116. return $this->readingStartTime;
  117. }
  118. /**
  119. * @param DateTime $readingStartTime
  120. */
  121. public function setReadingStartTime(?DateTime $readingStartTime): void
  122. {
  123. $this->readingStartTime = $readingStartTime;
  124. }
  125. /**
  126. * @return DateTime
  127. */
  128. public function getReadingStopTime(): ?DateTime
  129. {
  130. return $this->readingStopTime;
  131. }
  132. /**
  133. * @param DateTime $readingStopTime
  134. */
  135. public function setReadingStopTime(?DateTime $readingStopTime): void
  136. {
  137. $this->readingStopTime = $readingStopTime;
  138. }
  139. /**
  140. * @return float
  141. */
  142. public function getWordsPerMinute(): ?float
  143. {
  144. return $this->wordsPerMinute;
  145. }
  146. /**
  147. * @param float $wordsPerMinute
  148. */
  149. public function setWordsPerMinute(?float $wordsPerMinute): void
  150. {
  151. $this->wordsPerMinute = $wordsPerMinute;
  152. }
  153. /**
  154. * @return ReadingTestResponse[]
  155. */
  156. public function getReadingTestResponses()
  157. {
  158. return $this->readingTestResponses;
  159. }
  160. public function getExtendedDeadline(): ?DateTime
  161. {
  162. return $this->extendedDeadline;
  163. }
  164. public function setExtendedDeadline(DateTime $extendedDeadline): void
  165. {
  166. $this->extendedDeadline = $extendedDeadline;
  167. }
  168. }