src/Entity/Discipline.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\GuardianRegister\GuardianRegisterChildPreference;
  4. use App\Repository\DisciplineRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. /**
  10. * @ORM\Entity(repositoryClass=DisciplineRepository::class)
  11. */
  12. class Discipline
  13. {
  14. /**
  15. * @ORM\Id
  16. * @ORM\GeneratedValue
  17. * @ORM\Column(type="integer")
  18. * @Groups({"TeacherDisciplineClassesEdit","ResponsesList", "TeacherResponsesList", "ChildPreferenceAssignmentList", "DeclineHistoryList"})
  19. */
  20. private $id;
  21. /**
  22. * @ORM\Column(type="string", length=255, nullable=true)
  23. * @Groups({"LessonList","ChildPreferenceList","TeacherList","ResponsesList","TeacherSurveyList", "TeacherResponsesList", "ChildPreferenceAssignmentList", "DeclineHistoryList","TeacherRegisterList","ChildLessonReviewList"})
  24. */
  25. private $name;
  26. /**
  27. * @ORM\OneToMany(targetEntity=ChildPreference::class, mappedBy="discipline")
  28. */
  29. private $childPreferences;
  30. /**
  31. * @ORM\OneToMany(targetEntity=ChildPreferenceHistory::class, mappedBy="discipline")
  32. */
  33. private $childPreferenceHistories;
  34. /**
  35. * @ORM\OneToMany(targetEntity=Lesson::class, mappedBy="discipline")
  36. */
  37. private $lessons;
  38. /**
  39. * @ORM\ManyToMany(targetEntity=Teacher::class, mappedBy="disciplines")
  40. */
  41. private $teachers;
  42. /**
  43. * @ORM\OneToMany(targetEntity=TeacherDisciplineClass::class, mappedBy="discipline")
  44. */
  45. private $teacherDisciplineClasses;
  46. /**
  47. * @ORM\OneToMany(targetEntity=GuardianSurveyResponse::class, mappedBy="discipline")
  48. */
  49. private $guardianSurveyResponses;
  50. /**
  51. * @ORM\OneToMany(targetEntity=TeacherSurveyResponse::class, mappedBy="discipline")
  52. */
  53. private $teacherSurveyResponses;
  54. /**
  55. * @ORM\Column(type="string", length=255, nullable=true)
  56. * @Groups({"TeacherRegisterList"})
  57. */
  58. private $displayName;
  59. /**
  60. * @ORM\Column(type="datetime", nullable=true)
  61. */
  62. private $vbeDate;
  63. /**
  64. * @ORM\OneToMany(targetEntity=GuardianRegisterChildPreference::class, mappedBy="discipline")
  65. */
  66. private $guardianRegisterChildPreferences;
  67. /**
  68. * @ORM\OneToMany(targetEntity=ChildPreferenceDeclineHistory::class, mappedBy="discipline")
  69. */
  70. private $childPreferenceDeclineHistories;
  71. public function __construct()
  72. {
  73. $this->childPreferences = new ArrayCollection();
  74. $this->childPreferenceHistories = new ArrayCollection();
  75. $this->lessons = new ArrayCollection();
  76. $this->teachers = new ArrayCollection();
  77. $this->teacherDisciplineClasses = new ArrayCollection();
  78. $this->guardianSurveyResponses = new ArrayCollection();
  79. $this->teacherSurveyResponses = new ArrayCollection();
  80. $this->guardianRegisterChildPreferences = new ArrayCollection();
  81. $this->childPreferenceDeclineHistories = new ArrayCollection();
  82. }
  83. public function getId(): ?int
  84. {
  85. return $this->id;
  86. }
  87. public function getName(): ?string
  88. {
  89. return $this->name;
  90. }
  91. public function setName(?string $name): self
  92. {
  93. $this->name = $name;
  94. return $this;
  95. }
  96. /**
  97. * @return Collection|ChildPreferenceHistory[]
  98. */
  99. public function getChildPreferenceHistories(): Collection
  100. {
  101. return $this->childPreferenceHistories;
  102. }
  103. /**
  104. * @return Collection|ChildPreference[]
  105. */
  106. public function getChildPreferences(): Collection
  107. {
  108. return $this->childPreferences;
  109. }
  110. public function addChildPreference(ChildPreference $childPreference): self
  111. {
  112. if (!$this->childPreferences->contains($childPreference)) {
  113. $this->childPreferences[] = $childPreference;
  114. $childPreference->setDiscipline($this);
  115. }
  116. return $this;
  117. }
  118. public function removeChildPreference(ChildPreference $childPreference): self
  119. {
  120. if ($this->childPreferences->removeElement($childPreference)) {
  121. // set the owning side to null (unless already changed)
  122. if ($childPreference->getDiscipline() === $this) {
  123. $childPreference->setDiscipline(null);
  124. }
  125. }
  126. return $this;
  127. }
  128. public function __toString()
  129. {
  130. return "{$this->name}";
  131. }
  132. /**
  133. * @return Collection|Lesson[]
  134. */
  135. public function getLessons(): Collection
  136. {
  137. return $this->lessons;
  138. }
  139. public function addLesson(Lesson $lesson): self
  140. {
  141. if (!$this->lessons->contains($lesson)) {
  142. $this->lessons[] = $lesson;
  143. $lesson->setDiscipline($this);
  144. }
  145. return $this;
  146. }
  147. public function removeLesson(Lesson $lesson): self
  148. {
  149. if ($this->lessons->removeElement($lesson)) {
  150. // set the owning side to null (unless already changed)
  151. if ($lesson->getDiscipline() === $this) {
  152. $lesson->setDiscipline(null);
  153. }
  154. }
  155. return $this;
  156. }
  157. /**
  158. * @return Collection|Teacher[]
  159. */
  160. public function getTeachers(): Collection
  161. {
  162. return $this->teachers;
  163. }
  164. public function addTeacher(Teacher $teacher): self
  165. {
  166. if (!$this->teachers->contains($teacher)) {
  167. $this->teachers[] = $teacher;
  168. $teacher->addDiscipline($this);
  169. }
  170. return $this;
  171. }
  172. public function removeTeacher(Teacher $teacher): self
  173. {
  174. if ($this->teachers->removeElement($teacher)) {
  175. $teacher->removeDiscipline($this);
  176. }
  177. return $this;
  178. }
  179. /**
  180. * @return Collection|TeacherDisciplineClass[]
  181. */
  182. public function getTeacherDisciplineClasses(): Collection
  183. {
  184. return $this->teacherDisciplineClasses;
  185. }
  186. public function addTeacherDisciplineClass(TeacherDisciplineClass $teacherDisciplineClass): self
  187. {
  188. if (!$this->teacherDisciplineClasses->contains($teacherDisciplineClass)) {
  189. $this->teacherDisciplineClasses[] = $teacherDisciplineClass;
  190. $teacherDisciplineClass->setDiscipline($this);
  191. }
  192. return $this;
  193. }
  194. public function removeTeacherDisciplineClass(TeacherDisciplineClass $teacherDisciplineClass): self
  195. {
  196. if ($this->teacherDisciplineClasses->removeElement($teacherDisciplineClass)) {
  197. // set the owning side to null (unless already changed)
  198. if ($teacherDisciplineClass->getDiscipline() === $this) {
  199. $teacherDisciplineClass->setDiscipline(null);
  200. }
  201. }
  202. return $this;
  203. }
  204. /**
  205. * @return Collection|GuardianSurveyResponse[]
  206. */
  207. public function getGuardianSurveyResponses(): Collection
  208. {
  209. return $this->guardianSurveyResponses;
  210. }
  211. public function addGuardianSurveyResponse(GuardianSurveyResponse $guardianSurveyResponse): self
  212. {
  213. if (!$this->guardianSurveyResponses->contains($guardianSurveyResponse)) {
  214. $this->guardianSurveyResponses[] = $guardianSurveyResponse;
  215. $guardianSurveyResponse->setDiscipline($this);
  216. }
  217. return $this;
  218. }
  219. public function removeGuardianSurveyResponse(GuardianSurveyResponse $guardianSurveyResponse): self
  220. {
  221. if ($this->guardianSurveyResponses->removeElement($guardianSurveyResponse)) {
  222. // set the owning side to null (unless already changed)
  223. if ($guardianSurveyResponse->getDiscipline() === $this) {
  224. $guardianSurveyResponse->setDiscipline(null);
  225. }
  226. }
  227. return $this;
  228. }
  229. /**
  230. * @return Collection|TeacherSurveyResponse[]
  231. */
  232. public function getTeacherSurveyResponses(): Collection
  233. {
  234. return $this->teacherSurveyResponses;
  235. }
  236. public function addTeacherSurveyResponse(TeacherSurveyResponse $teacherSurveyResponse): self
  237. {
  238. if (!$this->teacherSurveyResponses->contains($teacherSurveyResponse)) {
  239. $this->teacherSurveyResponses[] = $teacherSurveyResponse;
  240. $teacherSurveyResponse->setDiscipline($this);
  241. }
  242. return $this;
  243. }
  244. public function removeTeacherSurveyResponse(TeacherSurveyResponse $teacherSurveyResponse): self
  245. {
  246. if ($this->teacherSurveyResponses->removeElement($teacherSurveyResponse)) {
  247. // set the owning side to null (unless already changed)
  248. if ($teacherSurveyResponse->getDiscipline() === $this) {
  249. $teacherSurveyResponse->setDiscipline(null);
  250. }
  251. }
  252. return $this;
  253. }
  254. public function getDisplayName(): ?string
  255. {
  256. return $this->displayName;
  257. }
  258. public function setDisplayName(?string $displayName): self
  259. {
  260. $this->displayName = $displayName;
  261. return $this;
  262. }
  263. public function getVbeDate(): ?\DateTimeInterface
  264. {
  265. return $this->vbeDate;
  266. }
  267. public function setVbeDate(?\DateTimeInterface $vbeDate): self
  268. {
  269. $this->vbeDate = $vbeDate;
  270. return $this;
  271. }
  272. /**
  273. * @return Collection<int, GuardianRegisterChildPreference>
  274. */
  275. public function getGuardianRegisterChildPreferences(): Collection
  276. {
  277. return $this->guardianRegisterChildPreferences;
  278. }
  279. public function addGuardianRegisterChildPreference(GuardianRegisterChildPreference $guardianRegisterChildPreference): self
  280. {
  281. if (!$this->guardianRegisterChildPreferences->contains($guardianRegisterChildPreference)) {
  282. $this->guardianRegisterChildPreferences[] = $guardianRegisterChildPreference;
  283. $guardianRegisterChildPreference->setDiscipline($this);
  284. }
  285. return $this;
  286. }
  287. public function removeGuardianRegisterChildPreference(GuardianRegisterChildPreference $guardianRegisterChildPreference): self
  288. {
  289. if ($this->guardianRegisterChildPreferences->removeElement($guardianRegisterChildPreference)) {
  290. // set the owning side to null (unless already changed)
  291. if ($guardianRegisterChildPreference->getDiscipline() === $this) {
  292. $guardianRegisterChildPreference->setDiscipline(null);
  293. }
  294. }
  295. return $this;
  296. }
  297. /**
  298. * @return Collection<int, ChildPreferenceDeclineHistory>
  299. */
  300. public function getChildPreferenceDeclineHistories(): Collection
  301. {
  302. return $this->childPreferenceDeclineHistories;
  303. }
  304. public function addChildPreferenceDeclineHistory(ChildPreferenceDeclineHistory $childPreferenceDeclineHistory): self
  305. {
  306. if (!$this->childPreferenceDeclineHistories->contains($childPreferenceDeclineHistory)) {
  307. $this->childPreferenceDeclineHistories[] = $childPreferenceDeclineHistory;
  308. $childPreferenceDeclineHistory->setDiscipline($this);
  309. }
  310. return $this;
  311. }
  312. public function removeChildPreferenceDeclineHistory(ChildPreferenceDeclineHistory $childPreferenceDeclineHistory): self
  313. {
  314. if ($this->childPreferenceDeclineHistories->removeElement($childPreferenceDeclineHistory)) {
  315. // set the owning side to null (unless already changed)
  316. if ($childPreferenceDeclineHistory->getDiscipline() === $this) {
  317. $childPreferenceDeclineHistory->setDiscipline(null);
  318. }
  319. }
  320. return $this;
  321. }
  322. }