src/Entity/Homework.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Entity(repositoryClass="App\Repository\HomeworkRepository")
  8. */
  9. class Homework
  10. {
  11. /**
  12. * @ORM\Id()
  13. * @ORM\GeneratedValue()
  14. * @ORM\Column(type="integer")
  15. */
  16. private $id;
  17. /**
  18. * @ORM\Column(type="datetime")
  19. */
  20. private $SentAt;
  21. /**
  22. * @ORM\ManyToOne(targetEntity="App\Entity\SubscriptionOrder", inversedBy="homeworks")
  23. */
  24. private $RelatedToSubscription;
  25. /**
  26. * @ORM\ManyToOne(targetEntity="App\Entity\SessionOrder", inversedBy="homeworks")
  27. */
  28. private $RelatedToGroupCourses;
  29. /**
  30. * @ORM\Column(type="boolean")
  31. */
  32. private $isCorrected;
  33. /**
  34. * @ORM\Column(type="datetime", nullable=true)
  35. */
  36. private $CorrectedAt;
  37. /**
  38. * @ORM\ManyToOne(targetEntity="App\Entity\Teacher", inversedBy="homeworks")
  39. * @ORM\JoinColumn(nullable=true)
  40. */
  41. private $CorrectedBy;
  42. /**
  43. * @ORM\OneToMany(targetEntity="App\Entity\HomeworkFiles", mappedBy="homework", orphanRemoval=true)
  44. */
  45. private $homeworkFiles;
  46. /**
  47. * @ORM\OneToMany(targetEntity="App\Entity\CorrectionFiles", mappedBy="homework", orphanRemoval=true)
  48. */
  49. private $correctionFiles;
  50. /**
  51. * @ORM\Column(type="string", length=150, nullable=true)
  52. */
  53. private $program;
  54. /**
  55. * @ORM\Column(type="string", length=100, nullable=true)
  56. */
  57. private $programLevel;
  58. /**
  59. * @ORM\Column(type="integer", nullable=true)
  60. */
  61. private $numPage;
  62. /**
  63. * @ORM\Column(type="integer", nullable=true)
  64. */
  65. private $numEx;
  66. public function __construct()
  67. {
  68. $this->homeworkFiles = new ArrayCollection();
  69. $this->correctionFiles = new ArrayCollection();
  70. }
  71. public function getId(): ?int
  72. {
  73. return $this->id;
  74. }
  75. public function getSentAt(): ?\DateTimeInterface
  76. {
  77. return $this->SentAt;
  78. }
  79. public function setSentAt(\DateTimeInterface $SentAt): self
  80. {
  81. $this->SentAt = $SentAt;
  82. return $this;
  83. }
  84. public function getRelatedToSubscription(): ?SubscriptionOrder
  85. {
  86. return $this->RelatedToSubscription;
  87. }
  88. public function setRelatedToSubscription(?SubscriptionOrder $RelatedToSubscription): self
  89. {
  90. $this->RelatedToSubscription = $RelatedToSubscription;
  91. return $this;
  92. }
  93. public function getRelatedToGroupCourses(): ?SessionOrder
  94. {
  95. return $this->RelatedToGroupCourses;
  96. }
  97. public function setRelatedToGroupCourses(?SessionOrder $RelatedToGroupCourses): self
  98. {
  99. $this->RelatedToGroupCourses = $RelatedToGroupCourses;
  100. return $this;
  101. }
  102. public function getIsCorrected(): ?bool
  103. {
  104. return $this->isCorrected;
  105. }
  106. public function setIsCorrected(bool $isCorrected): self
  107. {
  108. $this->isCorrected = $isCorrected;
  109. return $this;
  110. }
  111. public function getCorrectedAt(): ?\DateTimeInterface
  112. {
  113. return $this->CorrectedAt;
  114. }
  115. public function setCorrectedAt(\DateTimeInterface $CorrectedAt): self
  116. {
  117. $this->CorrectedAt = $CorrectedAt;
  118. return $this;
  119. }
  120. public function getCorrectedBy(): ?Teacher
  121. {
  122. return $this->CorrectedBy;
  123. }
  124. public function setCorrectedBy(?Teacher $CorrectedBy): self
  125. {
  126. $this->CorrectedBy = $CorrectedBy;
  127. return $this;
  128. }
  129. /**
  130. * @return Collection|HomeworkFiles[]
  131. */
  132. public function getHomeworkFiles(): Collection
  133. {
  134. return $this->homeworkFiles;
  135. }
  136. public function addHomeworkFile(HomeworkFiles $homeworkFile): self
  137. {
  138. if (!$this->homeworkFiles->contains($homeworkFile)) {
  139. $this->homeworkFiles[] = $homeworkFile;
  140. $homeworkFile->setHomework($this);
  141. }
  142. return $this;
  143. }
  144. public function removeHomeworkFile(HomeworkFiles $homeworkFile): self
  145. {
  146. if ($this->homeworkFiles->contains($homeworkFile)) {
  147. $this->homeworkFiles->removeElement($homeworkFile);
  148. // set the owning side to null (unless already changed)
  149. if ($homeworkFile->getHomework() === $this) {
  150. $homeworkFile->setHomework(null);
  151. }
  152. }
  153. return $this;
  154. }
  155. /**
  156. * @return Collection|CorrectionFiles[]
  157. */
  158. public function getCorrectionFiles(): Collection
  159. {
  160. return $this->correctionFiles;
  161. }
  162. public function addCorrectionFile(CorrectionFiles $correctionFile): self
  163. {
  164. if (!$this->correctionFiles->contains($correctionFile)) {
  165. $this->correctionFiles[] = $correctionFile;
  166. $correctionFile->setHomework($this);
  167. }
  168. return $this;
  169. }
  170. public function removeCorrectionFile(CorrectionFiles $correctionFile): self
  171. {
  172. if ($this->correctionFiles->contains($correctionFile)) {
  173. $this->correctionFiles->removeElement($correctionFile);
  174. // set the owning side to null (unless already changed)
  175. if ($correctionFile->getHomework() === $this) {
  176. $correctionFile->setHomework(null);
  177. }
  178. }
  179. return $this;
  180. }
  181. public function getProgram(): ?string
  182. {
  183. return $this->program;
  184. }
  185. public function setProgram(?string $program): self
  186. {
  187. $this->program = $program;
  188. return $this;
  189. }
  190. public function getProgramLevel(): ?string
  191. {
  192. return $this->programLevel;
  193. }
  194. public function setProgramLevel(?string $programLevel): self
  195. {
  196. $this->programLevel = $programLevel;
  197. return $this;
  198. }
  199. public function getNumPage(): ?string
  200. {
  201. return $this->numPage;
  202. }
  203. public function setNumPage(?string $numPage): self
  204. {
  205. $this->numPage = $numPage;
  206. return $this;
  207. }
  208. public function getNumEx(): ?int
  209. {
  210. return $this->numEx;
  211. }
  212. public function setNumEx(?int $numEx): self
  213. {
  214. $this->numEx = $numEx;
  215. return $this;
  216. }
  217. }