*/ #[ORM\OneToMany(mappedBy: 'subnet', targetEntity: OrganizationalUnit::class)] private Collection $organizationalUnits; /** * @var Collection */ #[ORM\OneToMany(mappedBy: 'subnet', targetEntity: Client::class)] private Collection $clients; public function __construct() { parent::__construct(); $this->organizationalUnits = new ArrayCollection(); $this->clients = new ArrayCollection(); } public function getNetmask(): ?string { return $this->netmask; } public function setNetmask(string $netmask): static { $this->netmask = $netmask; return $this; } public function getIpAddress(): ?string { return $this->ipAddress; } public function setIpAddress(string $ipAddress): static { $this->ipAddress = $ipAddress; return $this; } public function getNextServer(): ?string { return $this->nextServer; } public function setNextServer(string $nextServer): static { $this->nextServer = $nextServer; return $this; } public function getBootFileName(): ?string { return $this->bootFileName; } public function setBootFileName(string $bootFileName): static { $this->bootFileName = $bootFileName; return $this; } /** * @return Collection */ public function getOrganizationalUnits(): Collection { return $this->organizationalUnits; } public function setOrganizationalUnits(array $organizationalUnits): static { $this->organizationalUnits->clear(); foreach ($organizationalUnits as $organizationalUnit){ $this->addOrganizationalUnit($organizationalUnit); } return $this; } public function addOrganizationalUnit(OrganizationalUnit $organizationalUnit): static { if (!$this->organizationalUnits->contains($organizationalUnit)) { $this->organizationalUnits->add($organizationalUnit); $organizationalUnit->setSubnet($this); } return $this; } public function removeOrganizationalUnit(OrganizationalUnit $organizationalUnit): static { if ($this->organizationalUnits->removeElement($organizationalUnit)) { // set the owning side to null (unless already changed) if ($organizationalUnit->getSubnet() === $this) { $organizationalUnit->setSubnet(null); } } return $this; } /** * @return Collection */ public function getClients(): Collection { return $this->clients; } public function setClients(array $clients): static { $this->clients->clear(); foreach ($clients as $client){ $this->addClient($client); } return $this; } public function addClient(Client $client): static { if (!$this->clients->contains($client)) { $this->clients->add($client); $client->setSubnet($this); } return $this; } public function removeClient(Client $client): static { if ($this->clients->removeElement($client)) { // set the owning side to null (unless already changed) if ($client->getSubnet() === $this) { $client->setSubnet(null); } } return $this; } }