*/ #[ORM\OneToMany(targetEntity: DomainEntity::class, mappedBy: 'entity', orphanRemoval: true)] private Collection $domainEntities; /** * @var Collection */ #[ORM\OneToMany(targetEntity: NameserverEntity::class, mappedBy: 'entity')] private Collection $nameserverEntities; public function __construct() { $this->domainEntities = new ArrayCollection(); $this->nameserverEntities = new ArrayCollection(); } public function getHandle(): ?string { return $this->handle; } public function setHandle(string $handle): static { $this->handle = $handle; return $this; } /** * @return Collection */ public function getDomainEntities(): Collection { return $this->domainEntities; } public function addDomainEntity(DomainEntity $domainEntity): static { if (!$this->domainEntities->contains($domainEntity)) { $this->domainEntities->add($domainEntity); $domainEntity->setEntity($this); } return $this; } public function removeDomainEntity(DomainEntity $domainEntity): static { if ($this->domainEntities->removeElement($domainEntity)) { // set the owning side to null (unless already changed) if ($domainEntity->getEntity() === $this) { $domainEntity->setEntity(null); } } return $this; } /** * @return Collection */ public function getNameserverEntities(): Collection { return $this->nameserverEntities; } public function addNameserverEntity(NameserverEntity $nameserverEntity): static { if (!$this->nameserverEntities->contains($nameserverEntity)) { $this->nameserverEntities->add($nameserverEntity); $nameserverEntity->setEntity($this); } return $this; } public function removeNameserverEntity(NameserverEntity $nameserverEntity): static { if ($this->nameserverEntities->removeElement($nameserverEntity)) { // set the owning side to null (unless already changed) if ($nameserverEntity->getEntity() === $this) { $nameserverEntity->setEntity(null); } } return $this; } }