src/Entity/Exam.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ExamRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=ExamRepository::class)
  9. */
  10. class Exam
  11. {
  12. /**
  13. * @ORM\Id
  14. * @ORM\GeneratedValue
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\ManyToOne(targetEntity=User::class, inversedBy="exams")
  20. * @ORM\JoinColumn(nullable=false)
  21. */
  22. private $user;
  23. /**
  24. * @ORM\ManyToOne(targetEntity=Child::class, inversedBy="exams")
  25. */
  26. private $student;
  27. /**
  28. * @ORM\Column(type="string", length=100)
  29. */
  30. private $type;
  31. /**
  32. * @ORM\ManyToOne(targetEntity=Subject::class, inversedBy="exams")
  33. * @ORM\JoinColumn(nullable=false)
  34. */
  35. private $program;
  36. /**
  37. * @ORM\Column(type="string", length=50)
  38. */
  39. private $level;
  40. /**
  41. * @ORM\Column(type="date")
  42. */
  43. private $date;
  44. /**
  45. * @ORM\Column(type="boolean", options={"default":false})
  46. */
  47. private $isCorrected;
  48. /**
  49. * @ORM\Column(type="integer", nullable=true)
  50. */
  51. private $grade;
  52. /**
  53. * @ORM\Column(type="date", nullable=true)
  54. */
  55. private $correctedDate;
  56. /**
  57. * @ORM\Column(type="string", length=150, nullable=true)
  58. */
  59. private $correctedBy;
  60. /**
  61. * @ORM\OneToMany(targetEntity=ExamStudentFiles::class, mappedBy="exam", cascade={"remove"})
  62. */
  63. private $examStudentFiles;
  64. /**
  65. * @ORM\OneToMany(targetEntity=CorrectionExamFiles::class, mappedBy="exam", cascade={"remove"})
  66. */
  67. private $correctionExamFiles;
  68. /**
  69. * @ORM\ManyToOne(targetEntity=SubscriptionOrder::class, inversedBy="exams")
  70. */
  71. private $relatedToSubscription;
  72. /**
  73. * @ORM\ManyToOne(targetEntity=SessionOrder::class, inversedBy="exams")
  74. */
  75. private $relatedToGroupCourses;
  76. /**
  77. * @ORM\ManyToOne(targetEntity=TrainingReport::class, inversedBy="exams")
  78. */
  79. private $relatedToTrainingReport;
  80. public function __construct()
  81. {
  82. $this->examStudentFiles = new ArrayCollection();
  83. $this->correctionExamFiles = new ArrayCollection();
  84. }
  85. public function getId(): ?int
  86. {
  87. return $this->id;
  88. }
  89. public function getUser(): ?User
  90. {
  91. return $this->user;
  92. }
  93. public function setUser(?User $user): self
  94. {
  95. $this->user = $user;
  96. return $this;
  97. }
  98. public function getStudent(): ?Child
  99. {
  100. return $this->student;
  101. }
  102. public function setStudent(?Child $student): self
  103. {
  104. $this->student = $student;
  105. return $this;
  106. }
  107. public function getType(): ?string
  108. {
  109. return $this->type;
  110. }
  111. public function setType(string $type): self
  112. {
  113. $this->type = $type;
  114. return $this;
  115. }
  116. public function getProgram(): ?Subject
  117. {
  118. return $this->program;
  119. }
  120. public function setProgram(?Subject $program): self
  121. {
  122. $this->program = $program;
  123. return $this;
  124. }
  125. public function getLevel(): ?string
  126. {
  127. return $this->level;
  128. }
  129. public function setLevel(string $level): self
  130. {
  131. $this->level = $level;
  132. return $this;
  133. }
  134. public function getDate(): ?\DateTimeInterface
  135. {
  136. return $this->date;
  137. }
  138. public function setDate(\DateTimeInterface $date): self
  139. {
  140. $this->date = $date;
  141. return $this;
  142. }
  143. public function getIsCorrected(): ?bool
  144. {
  145. return $this->isCorrected;
  146. }
  147. public function setIsCorrected(bool $isCorrected): self
  148. {
  149. $this->isCorrected = $isCorrected;
  150. return $this;
  151. }
  152. public function getGrade(): ?int
  153. {
  154. return $this->grade;
  155. }
  156. public function setGrade(?int $grade): self
  157. {
  158. $this->grade = $grade;
  159. return $this;
  160. }
  161. public function getCorrectedDate(): ?\DateTimeInterface
  162. {
  163. return $this->correctedDate;
  164. }
  165. public function setCorrectedDate(?\DateTimeInterface $correctedDate): self
  166. {
  167. $this->correctedDate = $correctedDate;
  168. return $this;
  169. }
  170. public function getCorrectedBy(): ?string
  171. {
  172. return $this->correctedBy;
  173. }
  174. public function setCorrectedBy(?string $correctedBy): self
  175. {
  176. $this->correctedBy = $correctedBy;
  177. return $this;
  178. }
  179. /**
  180. * @return Collection|ExamStudentFiles[]
  181. */
  182. public function getExamStudentFiles(): Collection
  183. {
  184. return $this->examStudentFiles;
  185. }
  186. public function addExamStudentFile(ExamStudentFiles $examStudentFile): self
  187. {
  188. if (!$this->examStudentFiles->contains($examStudentFile)) {
  189. $this->examStudentFiles[] = $examStudentFile;
  190. $examStudentFile->setExam($this);
  191. }
  192. return $this;
  193. }
  194. public function removeExamStudentFile(ExamStudentFiles $examStudentFile): self
  195. {
  196. if ($this->examStudentFiles->removeElement($examStudentFile)) {
  197. // set the owning side to null (unless already changed)
  198. if ($examStudentFile->getExam() === $this) {
  199. $examStudentFile->setExam(null);
  200. }
  201. }
  202. return $this;
  203. }
  204. /**
  205. * @return Collection|CorrectionExamFiles[]
  206. */
  207. public function getCorrectionExamFiles(): Collection
  208. {
  209. return $this->correctionExamFiles;
  210. }
  211. public function addCorrectionExamFile(CorrectionExamFiles $correctionExamFile): self
  212. {
  213. if (!$this->correctionExamFiles->contains($correctionExamFile)) {
  214. $this->correctionExamFiles[] = $correctionExamFile;
  215. $correctionExamFile->setExam($this);
  216. }
  217. return $this;
  218. }
  219. public function removeCorrectionExamFile(CorrectionExamFiles $correctionExamFile): self
  220. {
  221. if ($this->correctionExamFiles->removeElement($correctionExamFile)) {
  222. // set the owning side to null (unless already changed)
  223. if ($correctionExamFile->getExam() === $this) {
  224. $correctionExamFile->setExam(null);
  225. }
  226. }
  227. return $this;
  228. }
  229. public function getRelatedToSubscription(): ?SubscriptionOrder
  230. {
  231. return $this->relatedToSubscription;
  232. }
  233. public function setRelatedToSubscription(?SubscriptionOrder $relatedToSubscription): self
  234. {
  235. $this->relatedToSubscription = $relatedToSubscription;
  236. return $this;
  237. }
  238. public function getRelatedToGroupCourses(): ?SessionOrder
  239. {
  240. return $this->relatedToGroupCourses;
  241. }
  242. public function setRelatedToGroupCourses(?SessionOrder $relatedToGroupCourses): self
  243. {
  244. $this->relatedToGroupCourses = $relatedToGroupCourses;
  245. return $this;
  246. }
  247. public function getRelatedToTrainingReport(): ?TrainingReport
  248. {
  249. return $this->relatedToTrainingReport;
  250. }
  251. public function setRelatedToTrainingReport(?TrainingReport $relatedToTrainingReport): self
  252. {
  253. $this->relatedToTrainingReport = $relatedToTrainingReport;
  254. return $this;
  255. }
  256. }