*/ #[ORM\OneToMany(mappedBy: 'operativeSystem', targetEntity: Partition::class)] private Collection $partitions; public function __construct() { parent::__construct(); $this->partitions = new ArrayCollection(); } /** * @return Collection */ public function getPartitions(): Collection { return $this->partitions; } public function addPartition(Partition $partition): static { if (!$this->partitions->contains($partition)) { $this->partitions->add($partition); $partition->setOperativeSystem($this); } return $this; } public function removePartition(Partition $partition): static { if ($this->partitions->removeElement($partition)) { // set the owning side to null (unless already changed) if ($partition->getOperativeSystem() === $this) { $partition->setOperativeSystem(null); } } return $this; } }