src/Entity/Website/VPN/OcServ/Server.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Website\VPN\OcServ;
  3. use App\Entity\BaseEntity;
  4. use App\Entity\Website\Country;
  5. use App\Entity\Website\Website\Website;
  6. use App\Repository\Website\VPN\OcServ\ServerRepository;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\DBAL\Types\Types;
  10. use Doctrine\ORM\Mapping as ORM;
  11. use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
  12. #[ORM\Table(name'`ocserv_server`')]
  13. #[ORM\Entity(repositoryClassServerRepository::class)]
  14. class Server extends BaseEntity
  15. {
  16.     #[ORM\Id]
  17.     #[ORM\Column(type'guid'uniquetrue)]
  18.     #[ORM\GeneratedValue(strategy'CUSTOM')]
  19.     #[ORM\CustomIdGenerator(class: UuidGenerator::class)]
  20.     private ?string $id null;
  21.     #[ORM\Column(length255)]
  22.     private ?string $ip null;
  23.     #[ORM\Column(length255)]
  24.     private ?string $sshUsername null;
  25.     #[ORM\Column(length255)]
  26.     private ?string $sshPassword null;
  27.     #[ORM\Column]
  28.     private ?int $servicePort null;
  29.     #[ORM\Column(length255)]
  30.     private ?string $name null;
  31.     #[ORM\ManyToOne(inversedBy'servers')]
  32.     #[ORM\JoinColumn(nullablefalse)]
  33.     private ?Country $country null;
  34.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  35.     private ?string $passwdContent null;
  36.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  37.     private ?string $note null;
  38.     #[ORM\Column(nullabletrue)]
  39.     private ?int $totalServicesCount null;
  40.     /**
  41.      * @var Collection<int, Protocol>
  42.      */
  43.     #[ORM\OneToMany(targetEntityProtocol::class, mappedBy'server')]
  44.     private Collection $protocols;
  45.     #[ORM\ManyToOne(inversedBy'servers')]
  46.     #[ORM\JoinColumn(nullabletrue)]
  47.     private ?Website $website null;
  48.     public function __construct()
  49.     {
  50.         parent::__construct();
  51.         $this->protocols = new ArrayCollection();
  52.     }
  53.     public function getId(): ?string
  54.     {
  55.         return $this->id;
  56.     }
  57.     public function getIp(): ?string
  58.     {
  59.         return $this->ip;
  60.     }
  61.     public function setIp(string $ip): static
  62.     {
  63.         $this->ip $ip;
  64.         return $this;
  65.     }
  66.     public function getSshUsername(): ?string
  67.     {
  68.         return $this->sshUsername;
  69.     }
  70.     public function setSshUsername(string $sshUsername): static
  71.     {
  72.         $this->sshUsername $sshUsername;
  73.         return $this;
  74.     }
  75.     public function getSshPassword(): ?string
  76.     {
  77.         return $this->sshPassword;
  78.     }
  79.     public function setSshPassword(string $sshPassword): static
  80.     {
  81.         $this->sshPassword $sshPassword;
  82.         return $this;
  83.     }
  84.     public function getServicePort(): ?int
  85.     {
  86.         return $this->servicePort;
  87.     }
  88.     public function setServicePort(int $servicePort): static
  89.     {
  90.         $this->servicePort $servicePort;
  91.         return $this;
  92.     }
  93.     public function getName(): ?string
  94.     {
  95.         return $this->name;
  96.     }
  97.     public function setName(string $name): static
  98.     {
  99.         $this->name $name;
  100.         return $this;
  101.     }
  102.     public function getCountry(): ?Country
  103.     {
  104.         return $this->country;
  105.     }
  106.     public function setCountry(?Country $country): static
  107.     {
  108.         $this->country $country;
  109.         return $this;
  110.     }
  111.     public function getPasswdContent(): ?string
  112.     {
  113.         return $this->passwdContent;
  114.     }
  115.     public function setPasswdContent(?string $passwdContent): static
  116.     {
  117.         $this->passwdContent $passwdContent;
  118.         return $this;
  119.     }
  120.     public function getNote(): ?string
  121.     {
  122.         return $this->note;
  123.     }
  124.     public function setNote(?string $note): static
  125.     {
  126.         $this->note $note;
  127.         return $this;
  128.     }
  129.     public function getTotalServicesCount(): ?int
  130.     {
  131.         return $this->totalServicesCount;
  132.     }
  133.     public function setTotalServicesCount(?int $totalServicesCount): static
  134.     {
  135.         $this->totalServicesCount $totalServicesCount;
  136.         return $this;
  137.     }
  138.     /**
  139.      * @return Collection<int, Protocol>
  140.      */
  141.     public function getProtocols(): Collection
  142.     {
  143.         return $this->protocols;
  144.     }
  145.     public function addProtocol(Protocol $protocol): static
  146.     {
  147.         if (!$this->protocols->contains($protocol)) {
  148.             $this->protocols->add($protocol);
  149.             $protocol->setServer($this);
  150.         }
  151.         return $this;
  152.     }
  153.     public function removeProtocol(Protocol $protocol): static
  154.     {
  155.         if ($this->protocols->removeElement($protocol)) {
  156.             // set the owning side to null (unless already changed)
  157.             if ($protocol->getServer() === $this) {
  158.                 $protocol->setServer(null);
  159.             }
  160.         }
  161.         return $this;
  162.     }
  163.     public function getWebsite(): ?Website
  164.     {
  165.         return $this->website;
  166.     }
  167.     public function setWebsite(?Website $website): static
  168.     {
  169.         $this->website $website;
  170.         return $this;
  171.     }
  172. }