<?php

namespace App\Entity;

use App\Repository\NetworkSettingsRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity(repositoryClass: NetworkSettingsRepository::class)]
class NetworkSettings extends AbstractEntity
{
    #[ORM\Column(length: 255, nullable: true)]
    private ?string $nextServer = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $bootFileName = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $proxy = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $dns = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $netmask = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $router = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $ntp = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $netiface = null;

    #[ORM\Column(nullable: true)]
    private ?int $p2pTime = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $p2pMode = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $mcastIp = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?int $mcastSpeed = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $mcastMode = null;

    #[ORM\Column(nullable: true)]
    private ?int $mcastPort = null;

    /**
     * @var Collection<int, OrganizationalUnit>
     */
    #[ORM\OneToMany(mappedBy: 'networkSettings', targetEntity: OrganizationalUnit::class)]
    private Collection $organizationalUnits;

    #[ORM\ManyToOne(targetEntity: Menu::class)]
    #[ORM\JoinColumn(nullable: true)]
    private ?Menu $menu = null;

    #[ORM\ManyToOne(targetEntity: HardwareProfile::class)]
    #[ORM\JoinColumn(nullable: true)]
    private ?HardwareProfile $hardwareProfile = null;

    #[ORM\ManyToOne]
    #[ORM\JoinColumn(onDelete: 'SET NULL')]
    private ?ImageRepository $repository = null;

    #[ORM\ManyToOne]
    #[ORM\JoinColumn( onDelete: 'SET NULL')]
    private ?OgLive $ogLive = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $ogShare = null;

    #[ORM\ManyToOne]
    private ?PxeTemplate $pxeTemplate = null;

    public function __construct()
    {
        parent::__construct();
        $this->organizationalUnits = new ArrayCollection();
    }

    public function getNextServer(): ?string
    {
        return $this->nextServer;
    }

    public function setNextServer(?string $nextServer): void
    {
        $this->nextServer = $nextServer;
    }

    public function getBootFileName(): ?string
    {
        return $this->bootFileName;
    }

    public function setBootFileName(?string $bootFileName): static
    {
        $this->bootFileName = $bootFileName;

        return $this;
    }

    public function getProxy(): ?string
    {
        return $this->proxy;
    }

    public function setProxy(?string $proxy): static
    {
        $this->proxy = $proxy;

        return $this;
    }

    public function getDns(): ?string
    {
        return $this->dns;
    }

    public function setDns(?string $dns): static
    {
        $this->dns = $dns;

        return $this;
    }

    public function getNetmask(): ?string
    {
        return $this->netmask;
    }

    public function setNetmask(?string $netmask): static
    {
        $this->netmask = $netmask;

        return $this;
    }

    public function getRouter(): ?string
    {
        return $this->router;
    }

    public function setRouter(?string $router): static
    {
        $this->router = $router;

        return $this;
    }

    public function getNtp(): ?string
    {
        return $this->ntp;
    }

    public function setNtp(?string $ntp): static
    {
        $this->ntp = $ntp;

        return $this;
    }

    public function getNetiface(): ?string
    {
        return $this->netiface;
    }

    public function setNetiface(?string $netiface): static
    {
        $this->netiface = $netiface;

        return $this;
    }

    public function getP2pTime(): ?int
    {
        return $this->p2pTime;
    }

    public function setP2pTime(?int $p2pTime): static
    {
        $this->p2pTime = $p2pTime;

        return $this;
    }

    public function getP2pMode(): ?string
    {
        return $this->p2pMode;
    }

    public function setP2pMode(?string $p2pMode): static
    {
        $this->p2pMode = $p2pMode;

        return $this;
    }

    public function getMcastIp(): ?string
    {
        return $this->mcastIp;
    }

    public function setMcastIp(?string $mcastIp): static
    {
        $this->mcastIp = $mcastIp;

        return $this;
    }

    public function getMcastSpeed(): ?int
    {
        return $this->mcastSpeed;
    }

    public function setMcastSpeed(?int $mcastSpeed): static
    {
        $this->mcastSpeed = $mcastSpeed;

        return $this;
    }

    public function getMcastMode(): ?string
    {
        return $this->mcastMode;
    }

    public function setMcastMode(?string $mcastMode): static
    {
        $this->mcastMode = $mcastMode;

        return $this;
    }

    public function getMcastPort(): ?int
    {
        return $this->mcastPort;
    }

    public function setMcastPort(?int $mcastPort): static
    {
        $this->mcastPort = $mcastPort;

        return $this;
    }

    /**
     * @return Collection<int, OrganizationalUnit>
     */
    public function getOrganizationalUnits(): Collection
    {
        return $this->organizationalUnits;
    }

    public function addOrganizationalUnit(OrganizationalUnit $organizationalUnit): static
    {
        if (!$this->organizationalUnits->contains($organizationalUnit)) {
            $this->organizationalUnits->add($organizationalUnit);
            $organizationalUnit->setNetworkSettings($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->getNetworkSettings() === $this) {
                $organizationalUnit->setNetworkSettings(null);
            }
        }

        return $this;
    }

    public function getMenu(): ?Menu
    {
        return $this->menu;
    }

    public function setMenu(?Menu $menu): static
    {
        $this->menu = $menu;

        return $this;
    }

    public function getHardwareProfile(): ?HardwareProfile
    {
        return $this->hardwareProfile;
    }

    public function setHardwareProfile(?HardwareProfile $hardwareProfile): static
    {
        $this->hardwareProfile = $hardwareProfile;

        return $this;
    }

    public function getRepository(): ?ImageRepository
    {
        return $this->repository;
    }

    public function setRepository(?ImageRepository $repository): static
    {
        $this->repository = $repository;

        return $this;
    }

    public function getOgLive(): ?OgLive
    {
        return $this->ogLive;
    }

    public function setOgLive(?OgLive $ogLive): static
    {
        $this->ogLive = $ogLive;

        return $this;
    }

    public function getOgShare(): ?string
    {
        return $this->ogShare;
    }

    public function setOgShare(?string $ogShare): static
    {
        $this->ogShare = $ogShare;

        return $this;
    }

    public function getPxeTemplate(): ?PxeTemplate
    {
        return $this->pxeTemplate;
    }

    public function setPxeTemplate(?PxeTemplate $pxeTemplate): static
    {
        $this->pxeTemplate = $pxeTemplate;

        return $this;
    }
}
