src/Entity/Website/VPN/V2ray/Server.php line 16

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