| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- <?php
- declare(strict_types=1);
- namespace App\Entity\Education;
- use ApiPlatform\Metadata\ApiResource;
- use App\Entity\Access\Access;
- use App\Entity\Billing\ResidenceArea;
- use App\Entity\Core\Tagg;
- // use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
- use App\Entity\Product\EquipmentList;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * EducationCurriculum suivi par un Access pendant une année scolaire
- */
- #[ApiResource(operations: [])]
- // #[Auditable]
- #[ORM\Entity]
- class EducationStudent
- {
- #[ORM\Id]
- #[ORM\Column]
- #[ORM\GeneratedValue]
- private ?int $id = null;
- #[ORM\ManyToOne(cascade: ['persist'], inversedBy: 'educationStudent')]
- #[ORM\JoinColumn(nullable: false)]
- private Access $access;
- #[ORM\ManyToOne(inversedBy: 'educationStudent')]
- #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
- private ?EducationCurriculum $educationCurriculum = null;
- /** @var Collection<int, Access> */
- #[ORM\ManyToMany(targetEntity: Access::class, inversedBy: 'educationStudentByTeacher')]
- #[ORM\JoinTable(name: 'educationstudent_teacher')]
- private Collection $teachers;
- /** @var Collection<int, EducationNotation> */
- #[ORM\OneToMany(targetEntity: EducationNotation::class, mappedBy: 'educationStudent', cascade: ['persist'], orphanRemoval: true)]
- private Collection $educationNotations;
- #[ORM\ManyToOne(inversedBy: 'referencedEducationStudent')]
- #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
- private ?EducationStudent $educationStudentLastYear = null;
- /** @var Collection<int, EducationStudent> */
- #[ORM\OneToMany(targetEntity: EducationStudent::class, mappedBy: 'educationStudentLastYear')]
- protected Collection $referencedEducationStudent;
- /** @var Collection<int, Tagg> */
- #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'educationStudents', cascade: ['persist'])]
- #[ORM\JoinTable(name: 'tag_educationStudent')]
- #[ORM\JoinColumn(name: 'educationStudent_id', referencedColumnName: 'id')]
- #[ORM\InverseJoinColumn(name: 'tag_id', referencedColumnName: 'id')]
- private Collection $tags;
- #[ORM\ManyToOne(inversedBy: 'educationStudents')]
- #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
- private ?EducationTiming $educationTiming = null;
- #[ORM\ManyToOne(targetEntity: EquipmentList::class, cascade: [])]
- #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
- protected ?EquipmentList $speciality;
- public function __construct()
- {
- $this->teachers = new ArrayCollection();
- $this->educationNotations = new ArrayCollection();
- $this->referencedEducationStudent = new ArrayCollection();
- $this->tags = new ArrayCollection();
- }
- public function getId(): ?int
- {
- return $this->id;
- }
- public function getAccess(): ?Access
- {
- return $this->access;
- }
- public function setAccess(?Access $access): self
- {
- $this->access = $access;
- return $this;
- }
- public function getEducationCurriculum(): ?EducationCurriculum
- {
- return $this->educationCurriculum;
- }
- public function setEducationCurriculum(?EducationCurriculum $educationCurriculum): self
- {
- $this->educationCurriculum = $educationCurriculum;
- return $this;
- }
- /**
- * @return Collection<int, Access>
- */
- public function getTeachers(): Collection
- {
- return $this->teachers;
- }
- public function addTeacher(Access $teacher): self
- {
- if (!$this->teachers->contains($teacher)) {
- $this->teachers[] = $teacher;
- }
- return $this;
- }
- public function removeTeacher(Access $teacher): self
- {
- $this->teachers->removeElement($teacher);
- return $this;
- }
- /**
- * @return Collection<int, EducationNotation>
- */
- public function getEducationNotations(): Collection
- {
- return $this->educationNotations;
- }
- public function addEducationNotation(EducationNotation $educationNotation): self
- {
- if (!$this->educationNotations->contains($educationNotation)) {
- $this->educationNotations[] = $educationNotation;
- $educationNotation->setEducationStudent($this);
- }
- return $this;
- }
- public function removeEducationNotation(EducationNotation $educationNotation): self
- {
- if ($this->educationNotations->removeElement($educationNotation)) {
- // set the owning side to null (unless already changed)
- if ($educationNotation->getEducationStudent() === $this) {
- $educationNotation->setEducationStudent(null);
- }
- }
- return $this;
- }
- public function getEducationStudentLastYear(): ?self
- {
- return $this->educationStudentLastYear;
- }
- public function setEducationStudentLastYear(?self $educationStudentLastYear): self
- {
- $this->educationStudentLastYear = $educationStudentLastYear;
- return $this;
- }
- /**
- * @return Collection<int, EducationStudent>
- */
- public function getReferencedEducationStudent(): Collection
- {
- return $this->referencedEducationStudent;
- }
- public function addReferencedEducationStudent(EducationStudent $referencedEducationStudent): self
- {
- if (!$this->referencedEducationStudent->contains($referencedEducationStudent)) {
- $this->referencedEducationStudent[] = $referencedEducationStudent;
- $referencedEducationStudent->setEducationStudentLastYear($this);
- }
- return $this;
- }
- public function removeReferencedEducationStudent(EducationStudent $referencedEducationStudent): self
- {
- if ($this->referencedEducationStudent->removeElement($referencedEducationStudent)) {
- // set the owning side to null (unless already changed)
- if ($referencedEducationStudent->getEducationStudentLastYear() === $this) {
- $referencedEducationStudent->setEducationStudentLastYear(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 getEducationTiming(): ?EducationTiming
- {
- return $this->educationTiming;
- }
- public function setEducationTiming(?EducationTiming $educationTiming): self
- {
- $this->educationTiming = $educationTiming;
- return $this;
- }
- public function getSpeciality(): ?EquipmentList
- {
- return $this->speciality;
- }
- public function setSpeciality(?EquipmentList $speciality): self
- {
- $this->speciality = $speciality;
- return $this;
- }
- }
|