src/CoreBundle/Entity/ReadingTestResponse.php line 12

Open in your IDE?
  1. <?php
  2. namespace CoreBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Table("reading_test_response")
  6. * @ORM\Entity(repositoryClass="CoreBundle\Entity\ReadingTestResponseRepository")
  7. */
  8. class ReadingTestResponse
  9. {
  10. /**
  11. * @var int
  12. *
  13. * @ORM\Column(name="id", type="integer")
  14. * @ORM\Id
  15. * @ORM\GeneratedValue(strategy="AUTO")
  16. */
  17. private $id;
  18. /**
  19. * @var ReadingTestUnit
  20. *
  21. * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\ReadingTestUnit", inversedBy="readingTestResponses")
  22. * @ORM\JoinColumn(name="reading_test_unit", referencedColumnName="id", onDelete="CASCADE")
  23. */
  24. private $readingTestUnit;
  25. /**
  26. * @var ReadingTest
  27. *
  28. * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\ReadingTest")
  29. * @ORM\JoinColumn(name="readingTest", referencedColumnName="id")
  30. */
  31. private $readingTest;
  32. /**
  33. * @var Mathproblem
  34. *
  35. * @ORM\ManyToOne(targetEntity="Mathproblem")
  36. * @ORM\JoinColumn(name="mathproblem", referencedColumnName="id", onDelete="CASCADE")
  37. */
  38. private $mathproblem;
  39. /**
  40. * @var Answer
  41. *
  42. * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\Answer")
  43. * @ORM\JoinColumn(name="answer", referencedColumnName="id", onDelete="RESTRICT")
  44. */
  45. private $answerChosen;
  46. /**
  47. * @var \DateTime
  48. *
  49. * @ORM\Column(name="createdAt", type="datetime", nullable=true)
  50. */
  51. private $createdAt;
  52. /**
  53. * @var string
  54. *
  55. * @ORM\Column(name="answer_text", type="text", nullable=true)
  56. */
  57. private $answerText;
  58. /**
  59. * @var int
  60. *
  61. * @ORM\Column(name="position", type="integer")
  62. */
  63. private $position;
  64. /**
  65. * @return int
  66. */
  67. public function getId(): int
  68. {
  69. return $this->id;
  70. }
  71. /**
  72. * @param int $id
  73. */
  74. public function setId(int $id): void
  75. {
  76. $this->id = $id;
  77. }
  78. /**
  79. * @return ReadingTestUnit
  80. */
  81. public function getReadingTestUnit(): ReadingTestUnit
  82. {
  83. return $this->readingTestUnit;
  84. }
  85. /**
  86. * @param ReadingTestUnit $readingTestUnit
  87. */
  88. public function setReadingTestUnit(ReadingTestUnit $readingTestUnit): void
  89. {
  90. $this->readingTestUnit = $readingTestUnit;
  91. }
  92. /**
  93. * @return ReadingTest
  94. */
  95. public function getReadingTest(): ReadingTest
  96. {
  97. return $this->readingTest;
  98. }
  99. /**
  100. * @param ReadingTest $readingTest
  101. */
  102. public function setReadingTest(ReadingTest $readingTest): void
  103. {
  104. $this->readingTest = $readingTest;
  105. }
  106. /**
  107. * @return Mathproblem
  108. */
  109. public function getMathproblem(): Mathproblem
  110. {
  111. return $this->mathproblem;
  112. }
  113. /**
  114. * @param Mathproblem $mathproblem
  115. */
  116. public function setMathproblem(Mathproblem $mathproblem): void
  117. {
  118. $this->mathproblem = $mathproblem;
  119. }
  120. /**
  121. * @return Answer
  122. */
  123. public function getAnswerChosen()
  124. {
  125. return $this->answerChosen;
  126. }
  127. /**
  128. * @param Answer $answerChosen
  129. * @return $this
  130. */
  131. public function setAnswerChosen($answerChosen)
  132. {
  133. $this->answerChosen = $answerChosen;
  134. $this->createdAt = new \DateTime("now");
  135. return $this;
  136. }
  137. /**
  138. * @return \DateTime
  139. */
  140. public function getCreatedAt(): ?\DateTime
  141. {
  142. return $this->createdAt;
  143. }
  144. /**
  145. * @param \DateTime $createdAt
  146. */
  147. public function setCreatedAt(?\DateTime $createdAt): void
  148. {
  149. $this->createdAt = $createdAt;
  150. }
  151. /**
  152. * @return string
  153. */
  154. public function getAnswerText(): string
  155. {
  156. return $this->answerText;
  157. }
  158. /**
  159. * @param string $answerText
  160. */
  161. public function setAnswerText(string $answerText): void
  162. {
  163. $this->answerText = $answerText;
  164. }
  165. /**
  166. * @return int
  167. */
  168. public function getPosition()
  169. {
  170. return $this->position;
  171. }
  172. /**
  173. * @param int $position
  174. * @return $this
  175. */
  176. public function setPosition($position)
  177. {
  178. $this->position = $position;
  179. return $this;
  180. }
  181. }