src/Entity/Website/Domains/Domain.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Website\Domains;
  3. use App\Entity\BaseEntity;
  4. use App\Entity\Generic\Customer\Customer;
  5. use App\Entity\Generic\User;
  6. use App\Entity\Website\Telegram\AgentPublicBot\Bot;
  7. use App\Entity\Website\Website\Website;
  8. use App\Repository\Website\Domains\DomainRepository;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Doctrine\Common\Collections\Collection;
  11. use Doctrine\ORM\Mapping as ORM;
  12. use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
  13. #[ORM\Entity(repositoryClassDomainRepository::class)]
  14. class Domain 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 $address null;
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $tgContact null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $tgChannle null;
  27.     #[ORM\Column(length255nullabletrue)]
  28.     private ?string $wallpaper null;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $appName null;
  31.     #[ORM\Column(length255nullabletrue)]
  32.     private ?string $ns1 null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     private ?string $ns2 null;
  35.     #[ORM\OneToMany(mappedBy'domain'targetEntityBot::class)]
  36.     private Collection $bots;
  37.     #[ORM\Column(length255nullabletrue)]
  38.     private ?string $logo null;
  39.     #[ORM\Column]
  40.     private ?bool $isConnected null;
  41.     #[ORM\ManyToOne(inversedBy'domains')]
  42.     #[ORM\JoinColumn(nullablefalse)]
  43.     private ?Customer $owner null;
  44.     #[ORM\ManyToOne(inversedBy'subPanelDomains')]
  45.     #[ORM\JoinColumn(nullablefalse)]
  46.     private ?Website $website null;
  47.     public function __construct()
  48.     {
  49.         parent::__construct();
  50.         $this->setIsConnected(0);
  51.         $this->bots = new ArrayCollection();
  52.     }
  53.     public function getNiceNs()
  54.     {
  55.         return 'NS1 : '.$this->getNs1().'<br>'.'NS2 : '.$this
  56.         ->getNs2();
  57.     }
  58.     public function __toString():string
  59.     {
  60.         return  $this->getAddress();
  61.     }
  62.     public function getId(): ?string
  63.     {
  64.         return $this->id;
  65.     }
  66.     public function getAddress(): ?string
  67.     {
  68.         return $this->address;
  69.     }
  70.     public function setAddress(string $address): static
  71.     {
  72.         $this->address $address;
  73.         return $this;
  74.     }
  75.     public function getOwner(): ?User
  76.     {
  77.         return $this->owner;
  78.     }
  79.     public function setOwner(?User $owner): static
  80.     {
  81.         $this->owner $owner;
  82.         return $this;
  83.     }
  84.     public function getTgContact(): ?string
  85.     {
  86.         return $this->tgContact;
  87.     }
  88.     public function setTgContact(?string $tgContact): static
  89.     {
  90.         $this->tgContact $tgContact;
  91.         return $this;
  92.     }
  93.     public function getTgChannle(): ?string
  94.     {
  95.         return $this->tgChannle;
  96.     }
  97.     public function setTgChannle(?string $tgChannle): static
  98.     {
  99.         $this->tgChannle $tgChannle;
  100.         return $this;
  101.     }
  102.     public function getWallpaper(): ?string
  103.     {
  104.         return $this->wallpaper;
  105.     }
  106.     public function setWallpaper(?string $wallpaper): static
  107.     {
  108.         $this->wallpaper $wallpaper;
  109.         return $this;
  110.     }
  111.     public function getAppName(): ?string
  112.     {
  113.         return $this->appName;
  114.     }
  115.     public function setAppName(?string $appName): static
  116.     {
  117.         $this->appName $appName;
  118.         return $this;
  119.     }
  120.     public function getNs1(): ?string
  121.     {
  122.         return $this->ns1;
  123.     }
  124.     public function setNs1(?string $ns1): static
  125.     {
  126.         $this->ns1 $ns1;
  127.         return $this;
  128.     }
  129.     public function getNs2(): ?string
  130.     {
  131.         return $this->ns2;
  132.     }
  133.     public function setNs2(?string $ns2): static
  134.     {
  135.         $this->ns2 $ns2;
  136.         return $this;
  137.     }
  138.     /**
  139.      * @return Collection<int, Bot>
  140.      */
  141.     public function getBots(): Collection
  142.     {
  143.         return $this->bots;
  144.     }
  145.     public function addBot(Bot $bot): static
  146.     {
  147.         if (!$this->bots->contains($bot)) {
  148.             $this->bots->add($bot);
  149.             $bot->setDomain($this);
  150.         }
  151.         return $this;
  152.     }
  153.     public function removeBot(Bot $bot): static
  154.     {
  155.         if ($this->bots->removeElement($bot)) {
  156.             // set the owning side to null (unless already changed)
  157.             if ($bot->getDomain() === $this) {
  158.                 $bot->setDomain(null);
  159.             }
  160.         }
  161.         return $this;
  162.     }
  163.     public function getLogo(): ?string
  164.     {
  165.         return $this->logo;
  166.     }
  167.     public function setLogo(?string $logo): static
  168.     {
  169.         $this->logo $logo;
  170.         return $this;
  171.     }
  172.     public function isIsConnected(): ?bool
  173.     {
  174.         return $this->isConnected;
  175.     }
  176.     public function setIsConnected(bool $isConnected): static
  177.     {
  178.         $this->isConnected $isConnected;
  179.         return $this;
  180.     }
  181.     public function getWebsite(): ?Website
  182.     {
  183.         return $this->website;
  184.     }
  185.     public function setWebsite(?Website $website): static
  186.     {
  187.         $this->website $website;
  188.         return $this;
  189.     }
  190. }