src/Entity/VPN/V2ray/Server.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\VPN\V2ray;
  3. use App\Entity\BaseEntity;
  4. use App\Entity\Country;
  5. use App\Repository\VPN\V2ray\ServerRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\DBAL\Types\Types;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
  11. #[ORM\Entity(repositoryClassServerRepository::class)]
  12. class Server extends BaseEntity
  13. {
  14.     #[ORM\Id]
  15.     #[ORM\Column(type'guid'uniquetrue)]
  16.     #[ORM\GeneratedValue(strategy'CUSTOM')]
  17.     #[ORM\CustomIdGenerator(class: UuidGenerator::class)]
  18.     private ?string $id null;
  19.     #[ORM\Column(length255)]
  20.     private ?string $ip null;
  21.     #[ORM\Column(length255)]
  22.     private ?string $sshUsername null;
  23.     #[ORM\Column(length255)]
  24.     private ?string $sshPassword null;
  25.     #[ORM\Column(length255)]
  26.     private ?string $panelType null;
  27.     #[ORM\Column(length255)]
  28.     private ?string $endpointAddress null;
  29.     #[ORM\Column(length255)]
  30.     private ?string $panelUsername null;
  31.     #[ORM\Column(length255)]
  32.     private ?string $panelPassword null;
  33.     #[ORM\Column]
  34.     private ?int $panelPort null;
  35.     #[ORM\Column(nullabletrue)]
  36.     private ?int $totalServicesCount null;
  37.     #[ORM\Column(length255)]
  38.     private ?string $name null;
  39.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  40.     private ?string $dbAddress null;
  41.     #[ORM\Column(length255)]
  42.     private ?string $usageScriptType null;
  43.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  44.     private ?\DateTimeInterface $lastScriptUpdate null;
  45.     #[ORM\Column]
  46.     private ?bool $isServerHasOwnerInfo null;
  47.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  48.     private ?string $note null;
  49.     #[ORM\ManyToOne(inversedBy'v2rayServers')]
  50.     #[ORM\JoinColumn(nullablefalse)]
  51.     private ?Country $country null;
  52.     /**
  53.      * @var Collection<int, Protocol>
  54.      */
  55.     #[ORM\OneToMany(targetEntityProtocol::class, mappedBy'server')]
  56.     private Collection $protocols;
  57.     #[ORM\Column(length255nullabletrue)]
  58.     private ?string $serverType null;
  59.     public function __construct()
  60.     {
  61.         parent::__construct();
  62.         $this->protocols = new ArrayCollection();
  63.     }
  64.     public function getId(): ?string
  65.     {
  66.         return $this->id;
  67.     }
  68.     public function getIp(): ?string
  69.     {
  70.         return $this->ip;
  71.     }
  72.     public function setIp(string $ip): static
  73.     {
  74.         $this->ip $ip;
  75.         return $this;
  76.     }
  77.     public function getSshUsername(): ?string
  78.     {
  79.         return $this->sshUsername;
  80.     }
  81.     public function setSshUsername(string $sshUsername): static
  82.     {
  83.         $this->sshUsername $sshUsername;
  84.         return $this;
  85.     }
  86.     public function getSshPassword(): ?string
  87.     {
  88.         return $this->sshPassword;
  89.     }
  90.     public function setSshPassword(string $sshPassword): static
  91.     {
  92.         $this->sshPassword $sshPassword;
  93.         return $this;
  94.     }
  95.     public function getPanelType(): ?string
  96.     {
  97.         return $this->panelType;
  98.     }
  99.     public function setPanelType(string $panelType): static
  100.     {
  101.         $this->panelType $panelType;
  102.         return $this;
  103.     }
  104.     public function getEndpointAddress(): ?string
  105.     {
  106.         return $this->endpointAddress;
  107.     }
  108.     public function setEndpointAddress(string $endpointAddress): static
  109.     {
  110.         $this->endpointAddress $endpointAddress;
  111.         return $this;
  112.     }
  113.     public function getPanelUsername(): ?string
  114.     {
  115.         return $this->panelUsername;
  116.     }
  117.     public function setPanelUsername(string $panelUsername): static
  118.     {
  119.         $this->panelUsername $panelUsername;
  120.         return $this;
  121.     }
  122.     public function getPanelPassword(): ?string
  123.     {
  124.         return $this->panelPassword;
  125.     }
  126.     public function setPanelPassword(string $panelPassword): static
  127.     {
  128.         $this->panelPassword $panelPassword;
  129.         return $this;
  130.     }
  131.     public function getPanelPort(): ?int
  132.     {
  133.         return $this->panelPort;
  134.     }
  135.     public function setPanelPort(int $panelPort): static
  136.     {
  137.         $this->panelPort $panelPort;
  138.         return $this;
  139.     }
  140.     public function getTotalServicesCount(): ?int
  141.     {
  142.         return $this->totalServicesCount;
  143.     }
  144.     public function setTotalServicesCount(?int $totalServicesCount): static
  145.     {
  146.         $this->totalServicesCount $totalServicesCount;
  147.         return $this;
  148.     }
  149.     public function getName(): ?string
  150.     {
  151.         return $this->name;
  152.     }
  153.     public function setName(string $name): static
  154.     {
  155.         $this->name $name;
  156.         return $this;
  157.     }
  158.     public function getDbAddress(): ?string
  159.     {
  160.         return $this->dbAddress;
  161.     }
  162.     public function setDbAddress(?string $dbAddress): static
  163.     {
  164.         $this->dbAddress $dbAddress;
  165.         return $this;
  166.     }
  167.     public function getUsageScriptType(): ?string
  168.     {
  169.         return $this->usageScriptType;
  170.     }
  171.     public function setUsageScriptType(string $usageScriptType): static
  172.     {
  173.         $this->usageScriptType $usageScriptType;
  174.         return $this;
  175.     }
  176.     public function getLastScriptUpdate(): ?\DateTimeInterface
  177.     {
  178.         return $this->lastScriptUpdate;
  179.     }
  180.     public function setLastScriptUpdate(?\DateTimeInterface $lastScriptUpdate): static
  181.     {
  182.         $this->lastScriptUpdate $lastScriptUpdate;
  183.         return $this;
  184.     }
  185.     public function isServerHasOwnerInfo(): ?bool
  186.     {
  187.         return $this->isServerHasOwnerInfo;
  188.     }
  189.     public function setIsServerHasOwnerInfo(bool $isServerHasOwnerInfo): static
  190.     {
  191.         $this->isServerHasOwnerInfo $isServerHasOwnerInfo;
  192.         return $this;
  193.     }
  194.     public function getNote(): ?string
  195.     {
  196.         return $this->note;
  197.     }
  198.     public function setNote(?string $note): static
  199.     {
  200.         $this->note $note;
  201.         return $this;
  202.     }
  203.     public function getCountry(): ?Country
  204.     {
  205.         return $this->country;
  206.     }
  207.     public function setCountry(?Country $country): static
  208.     {
  209.         $this->country $country;
  210.         return $this;
  211.     }
  212.     /**
  213.      * @return Collection<int, Protocol>
  214.      */
  215.     public function getProtocols(): Collection
  216.     {
  217.         return $this->protocols;
  218.     }
  219.     public function addProtocol(Protocol $protocol): static
  220.     {
  221.         if (!$this->protocols->contains($protocol)) {
  222.             $this->protocols->add($protocol);
  223.             $protocol->setServer($this);
  224.         }
  225.         return $this;
  226.     }
  227.     public function removeProtocol(Protocol $protocol): static
  228.     {
  229.         if ($this->protocols->removeElement($protocol)) {
  230.             // set the owning side to null (unless already changed)
  231.             if ($protocol->getServer() === $this) {
  232.                 $protocol->setServer(null);
  233.             }
  234.         }
  235.         return $this;
  236.     }
  237.     public function getServerType(): ?string
  238.     {
  239.         return $this->serverType;
  240.     }
  241.     public function setServerType(?string $serverType): static
  242.     {
  243.         $this->serverType $serverType;
  244.         return $this;
  245.     }
  246. }