src/CoreBundle/Entity/ReadingTestUnit.php line 14

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("reading_test_unit")
  7. * @ORM\Entity(repositoryClass="CoreBundle\Entity\ReadingTestUnitRepository")
  8. */
  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. */
  18. private $id;
  19. /**
  20. * @var ReadingTestSession
  21. *
  22. * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\ReadingTestSession", inversedBy="readingTestUnits")
  23. * @ORM\JoinColumn(name="reading_test_session", referencedColumnName="id", onDelete="CASCADE")
  24. */
  25. private $readingTestSession;
  26. /**
  27. * @var User
  28. *
  29. * @ORM\ManyToOne(targetEntity="UserBundle\Entity\User")
  30. * @ORM\JoinColumn(name="student", referencedColumnName="id")
  31. */
  32. private $student;
  33. /**
  34. * @var \DateTime
  35. * @ORM\Column(name="deadline", type="datetime", nullable=true)
  36. */
  37. private $deadline;
  38. /**
  39. * @var bool
  40. * @ORM\Column(name="finished", type="boolean", options={"default" : false})
  41. */
  42. private $finished;
  43. /**
  44. * @var \DateTime
  45. * @ORM\Column(name="reading_start_time", type="datetime", nullable=true)
  46. */
  47. private $readingStartTime;
  48. /**
  49. * @var \DateTime
  50. * @ORM\Column(name="reading_stop_time", type="datetime", nullable=true)
  51. */
  52. private $readingStopTime;
  53. /**
  54. * @var float
  55. * @ORM\Column(name="words_per_minute", type="float", nullable=true)
  56. */
  57. private $wordsPerMinute;
  58. /**
  59. * @var ReadingTestResponse[]
  60. *
  61. * @ORM\OneToMany(targetEntity="CoreBundle\Entity\ReadingTestResponse", mappedBy="readingTestUnit", cascade={"persist"})
  62. */
  63. private $readingTestResponses;
  64. /**
  65. * @var \DateTime
  66. *
  67. * @ORM\Column(name="extended_deadline", type="datetime", nullable=true)
  68. */
  69. private $extendedDeadline;
  70. /**
  71. * @return int
  72. */
  73. public function getId(): int
  74. {
  75. return $this->id;
  76. }
  77. /**
  78. * @param int $id
  79. */
  80. public function setId(int $id): void
  81. {
  82. $this->id = $id;
  83. }
  84. /**
  85. * @return ReadingTestSession
  86. */
  87. public function getReadingTestSession(): ReadingTestSession
  88. {
  89. return $this->readingTestSession;
  90. }
  91. /**
  92. * @param ReadingTestSession $readingTestSession
  93. */
  94. public function setReadingTestSession(ReadingTestSession $readingTestSession): void
  95. {
  96. $this->readingTestSession = $readingTestSession;
  97. }
  98. /**
  99. * @return User
  100. */
  101. public function getStudent(): User
  102. {
  103. return $this->student;
  104. }
  105. /**
  106. * @param User $student
  107. */
  108. public function setStudent(User $student): void
  109. {
  110. $this->student = $student;
  111. }
  112. /**
  113. * @return \DateTime
  114. */
  115. public function getDeadline(): ?\DateTime
  116. {
  117. return $this->deadline;
  118. }
  119. /**
  120. * @param \DateTime $deadline
  121. */
  122. public function setDeadline(?\DateTime $deadline): void
  123. {
  124. $this->deadline = $deadline;
  125. }
  126. /**
  127. * @return bool
  128. */
  129. public function isFinished(): bool
  130. {
  131. return $this->finished;
  132. }
  133. /**
  134. * @param bool $finished
  135. */
  136. public function setFinished(bool $finished): void
  137. {
  138. $this->finished = $finished;
  139. }
  140. /**
  141. * @return \DateTime
  142. */
  143. public function getReadingStartTime(): ?\DateTime
  144. {
  145. return $this->readingStartTime;
  146. }
  147. /**
  148. * @param \DateTime $readingStartTime
  149. */
  150. public function setReadingStartTime(?\DateTime $readingStartTime): void
  151. {
  152. $this->readingStartTime = $readingStartTime;
  153. }
  154. /**
  155. * @return \DateTime
  156. */
  157. public function getReadingStopTime(): ?\DateTime
  158. {
  159. return $this->readingStopTime;
  160. }
  161. /**
  162. * @param \DateTime $readingStopTime
  163. */
  164. public function setReadingStopTime(?\DateTime $readingStopTime): void
  165. {
  166. $this->readingStopTime = $readingStopTime;
  167. }
  168. /**
  169. * @return float
  170. */
  171. public function getWordsPerMinute(): ?float
  172. {
  173. return $this->wordsPerMinute;
  174. }
  175. /**
  176. * @param float $wordsPerMinute
  177. */
  178. public function setWordsPerMinute(?float $wordsPerMinute): void
  179. {
  180. $this->wordsPerMinute = $wordsPerMinute;
  181. }
  182. /**
  183. * @return ReadingTestResponse[]
  184. */
  185. public function getReadingTestResponses()
  186. {
  187. return $this->readingTestResponses;
  188. }
  189. public function getExtendedDeadline(): ?\DateTime
  190. {
  191. return $this->extendedDeadline;
  192. }
  193. public function setExtendedDeadline(\DateTime $extendedDeadline): void
  194. {
  195. $this->extendedDeadline = $extendedDeadline;
  196. }
  197. }