src/CoreBundle/Entity/TextbookSessionResponse.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. * link the response to the student and session
  7. * @ORM\Table("textbook_session_response")
  8. * @ORM\Entity(repositoryClass="CoreBundle\Entity\TextbookSessionResponseRepository")
  9. */
  10. class TextbookSessionResponse
  11. {
  12. /**
  13. * @var int
  14. *
  15. * @ORM\Column(name="id", type="integer")
  16. * @ORM\Id
  17. * @ORM\GeneratedValue(strategy="AUTO")
  18. */
  19. private $id;
  20. /**
  21. * @var User
  22. *
  23. * @ORM\ManyToOne(targetEntity="UserBundle\Entity\User")
  24. * @ORM\JoinColumn(name="student", referencedColumnName="id")
  25. */
  26. private $student;
  27. /**
  28. * @var TextbookSession
  29. *
  30. * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\TextbookSession")
  31. * @ORM\JoinColumn(name="textbook_session", referencedColumnName="id", onDelete="CASCADE")
  32. */
  33. private $textbookSession;
  34. /**
  35. * @var TextbookSubTopic
  36. *
  37. * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\TextbookSubTopic")
  38. * @ORM\JoinColumn(name="textbook_sub_topic", referencedColumnName="id", onDelete="CASCADE")
  39. */
  40. private $textbookSubTopic;
  41. /**
  42. * @var TextbookSubTopicQuestion
  43. *
  44. * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\TextbookSubTopicQuestion")
  45. * @ORM\JoinColumn(name="question", referencedColumnName="id", onDelete="CASCADE")
  46. */
  47. private $textbookSubTopicQuestion;
  48. /**
  49. * @var TextbookSubTopicAnswer
  50. *
  51. * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\TextbookSubTopicAnswer")
  52. * @ORM\JoinColumn(name="answer_chosen", referencedColumnName="id", onDelete="CASCADE")
  53. */
  54. private $answerChosen;
  55. /**
  56. * @var bool
  57. *
  58. * @ORM\Column(name="is_valid", type="boolean", nullable=true, options={"default":true})
  59. */
  60. private $isValid = true;
  61. /**
  62. * @var \DateTime
  63. *
  64. * @ORM\Column(name="archived_at", type="datetime", nullable=true)
  65. */
  66. private $archivedAt;
  67. public function __construct($student, $textbookSession, $textbookSubTopic, $textbookSubTopicQuestion, $answerChosen)
  68. {
  69. $this->student = $student;
  70. $this->textbookSession = $textbookSession;
  71. $this->textbookSubTopic = $textbookSubTopic;
  72. $this->textbookSubTopicQuestion = $textbookSubTopicQuestion;
  73. $this->answerChosen = $answerChosen;
  74. }
  75. /**
  76. * @return User
  77. */
  78. public function getStudent()
  79. {
  80. return $this->student;
  81. }
  82. /**
  83. * @param User $student
  84. */
  85. public function setStudent($student)
  86. {
  87. $this->student = $student;
  88. }
  89. /**
  90. * @return TextbookSession
  91. */
  92. public function getSession()
  93. {
  94. return $this->textbookSession;
  95. }
  96. /**
  97. * @param TextbookSession $session
  98. */
  99. public function setSession($session)
  100. {
  101. $this->textbookSession = $session;
  102. }
  103. /**
  104. * @return TextbookSubTopicQuestion
  105. */
  106. public function getQuestion()
  107. {
  108. return $this->textbookSubTopicQuestion;
  109. }
  110. /**
  111. * @param TextbookSubTopicQuestion $question
  112. */
  113. public function setQuestion($question)
  114. {
  115. $this->textbookSubTopicQuestion = $question;
  116. }
  117. /**
  118. * @return TextbookSubTopicAnswer
  119. */
  120. public function getAnswerChosen()
  121. {
  122. return $this->answerChosen;
  123. }
  124. /**
  125. * @param TextbookSubTopicAnswer $answerChosen
  126. */
  127. public function setAnswerChosen($answerChosen)
  128. {
  129. $this->answerChosen = $answerChosen;
  130. }
  131. /**
  132. * @return TextbookSubTopic
  133. */
  134. public function getTextbookSubTopic(): TextbookSubTopic
  135. {
  136. return $this->textbookSubTopic;
  137. }
  138. /**
  139. * @return bool
  140. */
  141. public function isValid(): bool
  142. {
  143. return $this->isValid;
  144. }
  145. /**
  146. * @param bool $isValid
  147. */
  148. public function setIsValid(bool $isValid): void
  149. {
  150. $this->isValid = $isValid;
  151. }
  152. /**
  153. * @return \DateTime|null
  154. */
  155. public function getArchivedAt(): ?\DateTime
  156. {
  157. return $this->archivedAt;
  158. }
  159. /**
  160. * @param \DateTime $archivedAt
  161. */
  162. public function setArchivedAt(\DateTime $archivedAt): void
  163. {
  164. $this->archivedAt = $archivedAt;
  165. }
  166. }