| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?php
- declare (strict_types=1);
- namespace App\Entity\Education;
- use ApiPlatform\Metadata\Get;
- use ApiPlatform\Metadata\ApiResource;
- use App\Entity\Access\Access;
- //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 EducationTeacher
- {
- #[ORM\Id]
- #[ORM\Column]
- #[ORM\GeneratedValue]
- private ?int $id = null;
- #[ORM\ManyToOne(inversedBy: 'educationTeachers')]
- #[ORM\JoinColumn(onDelete: 'CASCADE')]
- private Education $education;
- #[ORM\ManyToOne(inversedBy: 'educationTeachers')]
- private Access $teacher;
- #[ORM\OneToMany(mappedBy: 'educationTeacher', targetEntity: SeizurePeriodNotation::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
- private Collection $seizurePeriodNotations;
- public function __construct()
- {
- $this->seizurePeriodNotations = new ArrayCollection();
- }
- public function getId(): ?int
- {
- return $this->id;
- }
- public function getEducation(): ?Education
- {
- return $this->education;
- }
- public function setEducation(?Education $education): self
- {
- $this->education = $education;
- return $this;
- }
- public function getTeacher(): ?Access
- {
- return $this->teacher;
- }
- public function setTeacher(?Access $teacher): self
- {
- $this->teacher = $teacher;
- return $this;
- }
- /**
- * @return Collection<int, SeizurePeriodNotation>
- */
- public function getSeizurePeriodNotations(): Collection
- {
- return $this->seizurePeriodNotations;
- }
- public function addSeizurePeriodNotation(SeizurePeriodNotation $seizurePeriodNotation): self
- {
- if (!$this->seizurePeriodNotations->contains($seizurePeriodNotation)) {
- $this->seizurePeriodNotations[] = $seizurePeriodNotation;
- $seizurePeriodNotation->setEducationTeacher($this);
- }
- return $this;
- }
- public function removeSeizurePeriodNotation(SeizurePeriodNotation $seizurePeriodNotation): self
- {
- if ($this->seizurePeriodNotations->removeElement($seizurePeriodNotation)) {
- // set the owning side to null (unless already changed)
- if ($seizurePeriodNotation->getEducationTeacher() === $this) {
- $seizurePeriodNotation->setEducationTeacher(null);
- }
- }
- return $this;
- }
- }
|