<?phpnamespace App\Entity\Website;use App\Entity\Website\VPN\V2ray\Protocol;use App\Entity\Website\VPN\V2ray\Server;use App\Repository\Website\CountryRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use JetBrains\PhpStorm\Pure;use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;use App\Entity\BaseEntity;#[ORM\Entity(repositoryClass: CountryRepository::class)]class Country extends BaseEntity{ #[ORM\Id] #[ORM\Column(type: 'guid', unique: true)] #[ORM\GeneratedValue(strategy: 'CUSTOM')] #[ORM\CustomIdGenerator(class: UuidGenerator::class)] private ?string $id = null; #[ORM\Column(length: 255)] private ?string $title = null; #[ORM\Column(length: 255)] private ?string $code = null; #[ORM\Column(length: 255)] private ?string $flag = null; #[ORM\OneToMany(mappedBy: 'country', targetEntity: Server::class)] private Collection $v2rayServers; #[ORM\OneToMany(mappedBy: 'country', targetEntity: \App\Entity\Website\VPN\OpenVPN\Server::class)] private Collection $OpenVPNServers; #[ORM\OneToMany(mappedBy: 'country', targetEntity: \App\Entity\Website\VPN\OcServ\Server::class)] private Collection $servers; #[ORM\OneToMany(mappedBy: 'country', targetEntity: Protocol::class)] private Collection $protocols; public function __construct() { parent::__construct(); $this->protocols = new ArrayCollection(); } #[Pure] public function __toString() { return ($this->getTitle()); } public function getTitle(): ?string { return $this->title; } public function setTitle(string $title): self { $this->title = $title; return $this; } public function getCode(): ?string { return $this->code; } public function setCode(string $code): self { $this->code = $code; return $this; } public function getId(): ?string { return $this->id; } public function getFlag(): ?string { return $this->flag; } public function setFlag(string $flag): self { $this->flag = $flag; return $this; } /** * @return Collection<int, Protocol> */ public function getProtocols(): Collection { return $this->protocols; } public function addProtocol(Protocol $protocol): static { if (!$this->protocols->contains($protocol)) { $this->protocols->add($protocol); $protocol->setCountry($this); } return $this; } public function removeProtocol(Protocol $protocol): static { if ($this->protocols->removeElement($protocol)) { // set the owning side to null (unless already changed) if ($protocol->getCountry() === $this) { $protocol->setCountry(null); } } return $this; }}