*/ #[ORM\OneToMany(targetEntity: Education::class, mappedBy: 'educationCategory', orphanRemoval: true)] private Collection $educations; public function __construct() { $this->educations = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getOrganization(): ?Organization { return $this->organization; } public function setOrganization(?Organization $organization): self { $this->organization = $organization; return $this; } /** * @return Collection */ public function getEducations(): Collection { return $this->educations; } public function addEducation(Education $education): self { if (!$this->educations->contains($education)) { $this->educations[] = $education; $education->setEducationCategory($this); } return $this; } public function removeEducation(Education $education): self { if ($this->educations->removeElement($education)) { // set the owning side to null (unless already changed) if ($education->getEducationCategory() === $this) { $education->setEducationCategory(null); } } return $this; } }