| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272 |
- <?php
- declare (strict_types=1);
- namespace App\Entity\Education;
- use ApiPlatform\Metadata\Get;
- use ApiPlatform\Metadata\ApiResource;
- use App\Entity\Booking\Course;
- use App\Entity\Booking\Examen;
- use App\Entity\Core\Tagg;
- //use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * Classe ... qui ...
- */
- #[ApiResource(operations: [])]
- //#[Auditable]
- #[ORM\Entity]
- class Education
- {
- #[ORM\Id]
- #[ORM\Column]
- #[ORM\GeneratedValue]
- private ?int $id = null;
- #[ORM\OneToMany(mappedBy: 'education', targetEntity: EducationCurriculum::class, cascade: ['persist'], orphanRemoval: true)]
- private Collection $educationCurriculums;
- #[ORM\OneToMany(mappedBy: 'education', targetEntity: CycleByEducation::class, cascade: ['persist'], orphanRemoval: true)]
- private Collection $cycleByEducations;
- #[ORM\ManyToOne(fetch: 'EAGER', inversedBy: 'educations')]
- #[ORM\JoinColumn(nullable: false)]
- private EducationCategory $educationCategory;
- #[ORM\ManyToOne(fetch: 'EAGER')]
- #[ORM\JoinColumn(nullable: false)]
- private EducationComplement $educationComplement;
- #[ORM\OneToMany(mappedBy: 'education', targetEntity: Course::class)]
- private Collection $courses;
- #[ORM\OneToMany(mappedBy: 'education', targetEntity: Examen::class)]
- private Collection $examens;
- #[ORM\OneToMany(mappedBy: 'education', targetEntity: EducationTeacher::class, orphanRemoval: true)]
- private Collection $educationTeachers;
- #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'educations', cascade: ['persist'])]
- #[ORM\JoinTable(name: 'tag_education')]
- #[ORM\JoinColumn(name: 'education_id', referencedColumnName: 'id')]
- #[ORM\InverseJoinColumn(name: 'tag_id', referencedColumnName: 'id')]
- private Collection $tags;
- #[ORM\ManyToOne]
- #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
- private EducationNotationConfig $educationNotationConfig;
- public function __construct()
- {
- $this->educationCurriculums = new ArrayCollection();
- $this->cycleByEducations = new ArrayCollection();
- $this->courses = new ArrayCollection();
- $this->examens = new ArrayCollection();
- $this->educationTeachers = new ArrayCollection();
- $this->tags = new ArrayCollection();
- }
- public function getId(): ?int
- {
- return $this->id;
- }
- /**
- * @return Collection<int, EducationCurriculum>
- */
- public function getEducationCurriculums(): Collection
- {
- return $this->educationCurriculums;
- }
- public function addEducationCurriculum(EducationCurriculum $educationCurriculum): self
- {
- if (!$this->educationCurriculums->contains($educationCurriculum)) {
- $this->educationCurriculums[] = $educationCurriculum;
- $educationCurriculum->setEducation($this);
- }
- return $this;
- }
- public function removeEducationCurriculum(EducationCurriculum $educationCurriculum): self
- {
- if ($this->educationCurriculums->removeElement($educationCurriculum)) {
- // set the owning side to null (unless already changed)
- if ($educationCurriculum->getEducation() === $this) {
- $educationCurriculum->setEducation(null);
- }
- }
- return $this;
- }
- /**
- * @return Collection<int, CycleByEducation>
- */
- public function getCycleByEducations(): Collection
- {
- return $this->cycleByEducations;
- }
- public function addCycleByEducation(CycleByEducation $cycleByEducation): self
- {
- if (!$this->cycleByEducations->contains($cycleByEducation)) {
- $this->cycleByEducations[] = $cycleByEducation;
- $cycleByEducation->setEducation($this);
- }
- return $this;
- }
- public function removeCycleByEducation(CycleByEducation $cycleByEducation): self
- {
- if ($this->cycleByEducations->removeElement($cycleByEducation)) {
- // set the owning side to null (unless already changed)
- if ($cycleByEducation->getEducation() === $this) {
- $cycleByEducation->setEducation(null);
- }
- }
- return $this;
- }
- public function getEducationCategory(): ?EducationCategory
- {
- return $this->educationCategory;
- }
- public function setEducationCategory(?EducationCategory $educationCategory): self
- {
- $this->educationCategory = $educationCategory;
- return $this;
- }
- public function getEducationComplement(): ?EducationComplement
- {
- return $this->educationComplement;
- }
- public function setEducationComplement(?EducationComplement $educationComplement): self
- {
- $this->educationComplement = $educationComplement;
- return $this;
- }
- /**
- * @return Collection<int, Course>
- */
- public function getCourses(): Collection
- {
- return $this->courses;
- }
- public function addCourse(Course $course): self
- {
- if (!$this->courses->contains($course)) {
- $this->courses[] = $course;
- $course->setEducation($this);
- }
- return $this;
- }
- public function removeCourse(Course $course): self
- {
- if ($this->courses->removeElement($course)) {
- // set the owning side to null (unless already changed)
- if ($course->getEducation() === $this) {
- $course->setEducation(null);
- }
- }
- return $this;
- }
- /**
- * @return Collection<int, Examen>
- */
- public function getExamens(): Collection
- {
- return $this->examens;
- }
- public function addExamen(Examen $examen): self
- {
- if (!$this->examens->contains($examen)) {
- $this->examens[] = $examen;
- $examen->setEducation($this);
- }
- return $this;
- }
- public function removeExamen(Examen $examen): self
- {
- if ($this->examens->removeElement($examen)) {
- // set the owning side to null (unless already changed)
- if ($examen->getEducation() === $this) {
- $examen->setEducation(null);
- }
- }
- return $this;
- }
- /**
- * @return Collection<int, EducationTeacher>
- */
- public function getEducationTeachers(): Collection
- {
- return $this->educationTeachers;
- }
- public function addEducationTeacher(EducationTeacher $educationTeacher): self
- {
- if (!$this->educationTeachers->contains($educationTeacher)) {
- $this->educationTeachers[] = $educationTeacher;
- $educationTeacher->setEducation($this);
- }
- return $this;
- }
- public function removeEducationTeacher(EducationTeacher $educationTeacher): self
- {
- if ($this->educationTeachers->removeElement($educationTeacher)) {
- // set the owning side to null (unless already changed)
- if ($educationTeacher->getEducation() === $this) {
- $educationTeacher->setEducation(null);
- }
- }
- return $this;
- }
- /**
- * @return Collection<int, Tagg>
- */
- public function getTags(): Collection
- {
- return $this->tags;
- }
- public function addTag(Tagg $tag): self
- {
- if (!$this->tags->contains($tag)) {
- $this->tags[] = $tag;
- }
- return $this;
- }
- public function removeTag(Tagg $tag): self
- {
- $this->tags->removeElement($tag);
- return $this;
- }
- public function getEducationNotationConfig(): ?EducationNotationConfig
- {
- return $this->educationNotationConfig;
- }
- public function setEducationNotationConfig(?EducationNotationConfig $educationNotationConfig): self
- {
- $this->educationNotationConfig = $educationNotationConfig;
- return $this;
- }
- }
|