src/Entity/Website/Website/Website.php line 41

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Website\Website;
  3. use App\Entity\BaseEntity;
  4. use App\Entity\BaseSite\Domain;
  5. use App\Entity\BaseSite\Plan\AddOn;
  6. use App\Entity\BaseSite\Plan\Plan;
  7. use App\Entity\Generic\Customer\Customer;
  8. use App\Entity\Generic\User;
  9. use App\Entity\Website\Analytics;
  10. use App\Entity\Website\Analytics\ServersUsage;
  11. use App\Entity\Website\Campaign;
  12. use App\Entity\Website\Cms\Article;
  13. use App\Entity\Website\Cms\Category;
  14. use App\Entity\Website\Cms\Page;
  15. use App\Entity\Website\Cms\Tag;
  16. use App\Entity\Website\Cost;
  17. use App\Entity\Website\CostCategory;
  18. use App\Entity\Website\Setting;
  19. use App\Entity\Website\Sms\SmsIncome;
  20. use App\Entity\Website\SubTransactions\VasetPal;
  21. use App\Entity\Website\Telegram\AgentPublicBot\Bot;
  22. use App\Entity\Website\Transaction;
  23. use App\Entity\Website\VPN\OcServ\Server;
  24. use App\Entity\Website\VPN\Service\Service;
  25. use App\Repository\Website\Website\WebsiteRepository;
  26. use Doctrine\Common\Collections\ArrayCollection;
  27. use Doctrine\Common\Collections\Collection;
  28. use Doctrine\DBAL\Types\Types;
  29. use Doctrine\ORM\Mapping as ORM;
  30. use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
  31. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  32. #[ORM\Entity(repositoryClassWebsiteRepository::class)]
  33. #[UniqueEntity(fields: ['subdomain'], message'این نام کاربری فروشگاه از قبل موجود می باشد')]
  34. class Website extends BaseEntity
  35. {
  36.     #[ORM\Id]
  37.     #[ORM\Column(type'guid'uniquetrue)]
  38.     #[ORM\GeneratedValue(strategy'CUSTOM')]
  39.     #[ORM\CustomIdGenerator(class: UuidGenerator::class)]
  40.     private ?string $id;
  41.     #[ORM\Column(length255)]
  42.     private ?string $name null;
  43.     #[ORM\Column(length255uniquetrue)]
  44.     private ?string $subdomain null;
  45.     #[ORM\Column]
  46.     private ?float $shopBalance null;
  47.     #[ORM\ManyToOne(inversedBy'shops')]
  48.     #[ORM\JoinColumn(nullablefalse)]
  49.     private ?User $owner null;
  50.     #[ORM\OneToMany(mappedBy'website'targetEntityCustomer::class)]
  51.     private Collection $customers;
  52.     #[ORM\Column(length255nullabletrue)]
  53.     private ?string $theme null;
  54.     #[ORM\Column(nullabletrue)]
  55.     private ?array $analyticsData null;
  56.     #[ORM\Column(nullabletrue)]
  57.     private ?\DateTimeImmutable $expiredAt null;
  58.     #[ORM\OneToMany(mappedBy'website'targetEntityTransaction::class)]
  59.     private Collection $transactions;
  60.     #[ORM\Column(typeTypes::BIGINT)]
  61.     private ?string $trafficUsage null;
  62.     #[ORM\OneToMany(mappedBy'website'targetEntityDomain::class)]
  63.     private Collection $domains;
  64.     #[ORM\ManyToOne(inversedBy'shops')]
  65.     private ?Plan $currentPlan null;
  66.     #[ORM\OneToMany(mappedBy'website'targetEntityAddOn::class)]
  67.     private Collection $addOns;
  68.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  69.     private ?\DateTimeInterface $planStartedAt null;
  70.     #[ORM\OneToMany(mappedBy'website'targetEntitySetting::class)]
  71.     private Collection $settings;
  72.     #[ORM\OneToMany(mappedBy'website'targetEntityServersUsage::class)]
  73.     private Collection $serversUsages;
  74.     #[ORM\OneToMany(mappedBy'website'targetEntityArticle::class)]
  75.     private Collection $articles;
  76.     #[ORM\OneToMany(mappedBy'website'targetEntityCategory::class)]
  77.     private Collection $categories;
  78.     #[ORM\OneToMany(mappedBy'website'targetEntityPage::class)]
  79.     private Collection $pages;
  80.     #[ORM\OneToMany(mappedBy'website'targetEntityTag::class)]
  81.     private Collection $tags;
  82.     #[ORM\OneToMany(mappedBy'website'targetEntity\App\Entity\Website\Domains\Domain::class)]
  83.     private Collection $subPanelDomains;
  84.     #[ORM\OneToMany(mappedBy'website'targetEntitySmsIncome::class)]
  85.     private Collection $smsIncomes;
  86.     #[ORM\OneToMany(mappedBy'website'targetEntityVasetPal::class)]
  87.     private Collection $vasetPals;
  88.     #[ORM\OneToMany(mappedBy'website'targetEntityBot::class)]
  89.     private Collection $bots;
  90.     #[ORM\OneToMany(mappedBy'website'targetEntityAnalytics::class)]
  91.     private Collection $analytics;
  92.     #[ORM\OneToMany(mappedBy'website'targetEntityCampaign::class)]
  93.     private Collection $campaigns;
  94.     #[ORM\OneToMany(mappedBy'website'targetEntityCost::class)]
  95.     private Collection $costs;
  96.     #[ORM\OneToMany(mappedBy'website'targetEntityCostCategory::class)]
  97.     private Collection $costCategories;
  98.     #[ORM\OneToMany(mappedBy'website'targetEntityTransaction::class)]
  99.     private Collection $websiteTransactions;
  100.     #[ORM\OneToMany(mappedBy'website'targetEntityService::class)]
  101.     private Collection $services;
  102.     #[ORM\OneToMany(mappedBy'website'targetEntityServer::class)]
  103.     private Collection $servers;
  104.     #[ORM\OneToMany(mappedBy'website'targetEntity\App\Entity\Website\VPN\OpenVPN\Server::class)]
  105.     private Collection $openVPNServers;
  106.     #[ORM\OneToMany(mappedBy'website'targetEntity\App\Entity\Website\VPN\Service\Plan::class)]
  107.     private Collection $plans;
  108.     #[ORM\OneToMany(mappedBy'website'targetEntity\App\Entity\Website\VPN\V2ray\Server::class)]
  109.     private Collection $v2rayServers;
  110.     public function subdomainAddress()
  111.     {
  112.         return $this->subdomain.'.tehranabr.org';
  113.     }
  114.     public function __construct()
  115.     {
  116.         $this->setTrafficUsage(0);
  117.         parent::__construct();
  118.         $now = new \DateTimeImmutable();
  119.         $this->setExpiredAt($now->modify("+7 days"));
  120.         $this->setPlanStartedAt($now);
  121.         $this->shopBalance 0;
  122.         $this->customers = new ArrayCollection();
  123.         $this->pages = new ArrayCollection();
  124.         $this->articles = new ArrayCollection();
  125.         $this->categories = new ArrayCollection();
  126.         $this->tags = new ArrayCollection();
  127.         $this->transactions = new ArrayCollection();
  128.         $this->domains = new ArrayCollection();
  129.         $this->addOns = new ArrayCollection();
  130.         $this->settings = new ArrayCollection();
  131.         $this->serversUsages = new ArrayCollection();
  132.         $this->subPanelDomains = new ArrayCollection();
  133.         $this->smsIncomes = new ArrayCollection();
  134.         $this->vasetPals = new ArrayCollection();
  135.         $this->bots = new ArrayCollection();
  136.         $this->analytics = new ArrayCollection();
  137.         $this->campaigns = new ArrayCollection();
  138.         $this->costs = new ArrayCollection();
  139.         $this->costCategories = new ArrayCollection();
  140.         $this->websiteTransactions = new ArrayCollection();
  141.         $this->services = new ArrayCollection();
  142.         $this->servers = new ArrayCollection();
  143.         $this->openVPNServers = new ArrayCollection();
  144.         $this->plans = new ArrayCollection();
  145.         $this->v2rayServers = new ArrayCollection();
  146.     }
  147.     public function getId(): ?string
  148.     {
  149.         return $this->id;
  150.     }
  151.     public function getName(): ?string
  152.     {
  153.         return $this->name;
  154.     }
  155.     public function setName(string $name): static
  156.     {
  157.         $this->name $name;
  158.         return $this;
  159.     }
  160.     public function getSubdomain(): ?string
  161.     {
  162.         return $this->subdomain;
  163.     }
  164.     public function setSubdomain(string $subdomain): static
  165.     {
  166.         $this->subdomain $subdomain;
  167.         return $this;
  168.     }
  169.     public function getShopBalance(): ?float
  170.     {
  171.         return $this->shopBalance;
  172.     }
  173.     public function setShopBalance(float $shopBalance): static
  174.     {
  175.         $this->shopBalance $shopBalance;
  176.         return $this;
  177.     }
  178.     public function getOwner(): ?User
  179.     {
  180.         return $this->owner;
  181.     }
  182.     public function setOwner(?User $owner): static
  183.     {
  184.         $this->owner $owner;
  185.         return $this;
  186.     }
  187.     /**
  188.      * @return Collection<int, Customer>
  189.      */
  190.     public function getCustomers(): Collection
  191.     {
  192.         return $this->customers;
  193.     }
  194.     public function addCustomer(Customer $customer): static
  195.     {
  196.         if (!$this->customers->contains($customer)) {
  197.             $this->customers->add($customer);
  198.             $customer->setWebsite($this);
  199.         }
  200.         return $this;
  201.     }
  202.     public function removeCustomer(Customer $customer): static
  203.     {
  204.         if ($this->customers->removeElement($customer)) {
  205.             // set the owning side to null (unless already changed)
  206.             if ($customer->getWebsite() === $this) {
  207.                 $customer->setWebsite(null);
  208.             }
  209.         }
  210.         return $this;
  211.     }
  212.     public function getTheme(): ?string
  213.     {
  214.         if ($this->theme == null){
  215.             return 'default';
  216.         }
  217.         return $this->theme;
  218.     }
  219.     public function setTheme(?string $theme): static
  220.     {
  221.         $this->theme $theme;
  222.         return $this;
  223.     }
  224.     public function getAnalyticsData(): ?array
  225.     {
  226.         return $this->analyticsData;
  227.     }
  228.     public function setAnalyticsData(?array $analyticsData): static
  229.     {
  230.         $this->analyticsData $analyticsData;
  231.         return $this;
  232.     }
  233.     public function getExpiredAt(): ?\DateTimeImmutable
  234.     {
  235.         return $this->expiredAt;
  236.     }
  237.     public function setExpiredAt(?\DateTimeImmutable $expiredAt): static
  238.     {
  239.         $this->expiredAt $expiredAt;
  240.         return $this;
  241.     }
  242.     /**
  243.      * @return Collection<int, Page>
  244.      */
  245.     public function getPages(): Collection
  246.     {
  247.         return $this->pages;
  248.     }
  249.     public function addPage(Page $page): static
  250.     {
  251.         if (!$this->pages->contains($page)) {
  252.             $this->pages->add($page);
  253.             $page->setWebsite($this);
  254.         }
  255.         return $this;
  256.     }
  257.     public function removePage(Page $page): static
  258.     {
  259.         if ($this->pages->removeElement($page)) {
  260.             // set the owning side to null (unless already changed)
  261.             if ($page->getWebsite() === $this) {
  262.                 $page->setWebsite(null);
  263.             }
  264.         }
  265.         return $this;
  266.     }
  267.     /**
  268.      * @return Collection<int, Article>
  269.      */
  270.     public function getArticles(): Collection
  271.     {
  272.         return $this->articles;
  273.     }
  274.     public function addArticle(Article $article): static
  275.     {
  276.         if (!$this->articles->contains($article)) {
  277.             $this->articles->add($article);
  278.             $article->setWebsite($this);
  279.         }
  280.         return $this;
  281.     }
  282.     public function removeArticle(Article $article): static
  283.     {
  284.         if ($this->articles->removeElement($article)) {
  285.             // set the owning side to null (unless already changed)
  286.             if ($article->getWebsite() === $this) {
  287.                 $article->setWebsite(null);
  288.             }
  289.         }
  290.         return $this;
  291.     }
  292.     /**
  293.      * @return Collection<int, Category>
  294.      */
  295.     public function getCategories(): Collection
  296.     {
  297.         return $this->categories;
  298.     }
  299.     public function addCategory(Category $category): static
  300.     {
  301.         if (!$this->categories->contains($category)) {
  302.             $this->categories->add($category);
  303.             $category->setWebsite($this);
  304.         }
  305.         return $this;
  306.     }
  307.     public function removeCategory(Category $category): static
  308.     {
  309.         if ($this->categories->removeElement($category)) {
  310.             // set the owning side to null (unless already changed)
  311.             if ($category->getWebsite() === $this) {
  312.                 $category->setWebsite(null);
  313.             }
  314.         }
  315.         return $this;
  316.     }
  317.     /**
  318.      * @return Collection<int, Tag>
  319.      */
  320.     public function getTags(): Collection
  321.     {
  322.         return $this->tags;
  323.     }
  324.     public function addTag(Tag $tag): static
  325.     {
  326.         if (!$this->tags->contains($tag)) {
  327.             $this->tags->add($tag);
  328.             $tag->setWebsite($this);
  329.         }
  330.         return $this;
  331.     }
  332.     public function removeTag(Tag $tag): static
  333.     {
  334.         if ($this->tags->removeElement($tag)) {
  335.             // set the owning side to null (unless already changed)
  336.             if ($tag->getWebsite() === $this) {
  337.                 $tag->setWebsite(null);
  338.             }
  339.         }
  340.         return $this;
  341.     }
  342.     /**
  343.      * @return Collection<int, Transaction>
  344.      */
  345.     public function getTransactions(): Collection
  346.     {
  347.         return $this->transactions;
  348.     }
  349.     public function addTransaction(Transaction $transaction): static
  350.     {
  351.         if (!$this->transactions->contains($transaction)) {
  352.             $this->transactions->add($transaction);
  353.             $transaction->getWebsite($this);
  354.         }
  355.         return $this;
  356.     }
  357.     public function removeTransaction(Transaction $transaction): static
  358.     {
  359.         if ($this->transactions->removeElement($transaction)) {
  360.             // set the owning side to null (unless already changed)
  361.             if ($transaction->getWebsite() === $this) {
  362.                 $transaction->setWebsite(null);
  363.             }
  364.         }
  365.         return $this;
  366.     }
  367.     public function getTrafficUsage(): ?string
  368.     {
  369.         return $this->trafficUsage;
  370.     }
  371.     public function setTrafficUsage(string $trafficUsage): static
  372.     {
  373.         $this->trafficUsage $trafficUsage;
  374.         return $this;
  375.     }
  376.     public function getCurrentPlanString()
  377.     {
  378.         if ($this->currentPlan){
  379.            return $this->currentPlan->getTitle();
  380.         }else{
  381.             return '';
  382.         }
  383.     }
  384.     /**
  385.      * @return Collection<int, Domain>
  386.      */
  387.     public function getDomains(): Collection
  388.     {
  389.         return $this->domains;
  390.     }
  391.     public function addDomain(Domain $domain): static
  392.     {
  393.         if (!$this->domains->contains($domain)) {
  394.             $this->domains->add($domain);
  395.             $domain->setWebsite($this);
  396.         }
  397.         return $this;
  398.     }
  399.     public function removeDomain(Domain $domain): static
  400.     {
  401.         if ($this->domains->removeElement($domain)) {
  402.             // set the owning side to null (unless already changed)
  403.             if ($domain->getWebsite() === $this) {
  404.                 $domain->setWebsite(null);
  405.             }
  406.         }
  407.         return $this;
  408.     }
  409.     public function getCurrentPlan(): ?Plan
  410.     {
  411.         return $this->currentPlan;
  412.     }
  413.     public function setCurrentPlan(?Plan $currentPlan): static
  414.     {
  415.         $this->currentPlan $currentPlan;
  416.         return $this;
  417.     }
  418.     /**
  419.      * @return Collection<int, AddOn>
  420.      */
  421.     public function getAddOns(): Collection
  422.     {
  423.         return $this->addOns;
  424.     }
  425.     public function addAddOn(AddOn $addOn): static
  426.     {
  427.         if (!$this->addOns->contains($addOn)) {
  428.             $this->addOns->add($addOn);
  429.             $addOn->setWebsite($this);
  430.         }
  431.         return $this;
  432.     }
  433.     public function removeAddOn(AddOn $addOn): static
  434.     {
  435.         if ($this->addOns->removeElement($addOn)) {
  436.             // set the owning side to null (unless already changed)
  437.             if ($addOn->getWebsite() === $this) {
  438.                 $addOn->getWebsite(null);
  439.             }
  440.         }
  441.         return $this;
  442.     }
  443.     public function getPlanStartedAt(): ?\DateTimeInterface
  444.     {
  445.         return $this->planStartedAt;
  446.     }
  447.     public function setPlanStartedAt(?\DateTimeInterface $planStartedAt): static
  448.     {
  449.         $this->planStartedAt $planStartedAt;
  450.         return $this;
  451.     }
  452.     /**
  453.      * @return Collection<int, Setting>
  454.      */
  455.     public function getSettings(): Collection
  456.     {
  457.         return $this->settings;
  458.     }
  459.     public function addSetting(Setting $setting): static
  460.     {
  461.         if (!$this->settings->contains($setting)) {
  462.             $this->settings->add($setting);
  463.             $setting->setWebsite($this);
  464.         }
  465.         return $this;
  466.     }
  467.     public function removeSetting(Setting $setting): static
  468.     {
  469.         if ($this->settings->removeElement($setting)) {
  470.             // set the owning side to null (unless already changed)
  471.             if ($setting->getWebsite() === $this) {
  472.                 $setting->setWebsite(null);
  473.             }
  474.         }
  475.         return $this;
  476.     }
  477.     /**
  478.      * @return Collection<int, ServersUsage>
  479.      */
  480.     public function getServersUsages(): Collection
  481.     {
  482.         return $this->serversUsages;
  483.     }
  484.     public function addServersUsage(ServersUsage $serversUsage): static
  485.     {
  486.         if (!$this->serversUsages->contains($serversUsage)) {
  487.             $this->serversUsages->add($serversUsage);
  488.             $serversUsage->setWebsite($this);
  489.         }
  490.         return $this;
  491.     }
  492.     public function removeServersUsage(ServersUsage $serversUsage): static
  493.     {
  494.         if ($this->serversUsages->removeElement($serversUsage)) {
  495.             // set the owning side to null (unless already changed)
  496.             if ($serversUsage->getWebsite() === $this) {
  497.                 $serversUsage->setWebsite(null);
  498.             }
  499.         }
  500.         return $this;
  501.     }
  502.     /**
  503.      * @return Collection<int, \App\Entity\Website\Domains\Domain>
  504.      */
  505.     public function getSubPanelDomains(): Collection
  506.     {
  507.         return $this->subPanelDomains;
  508.     }
  509.     public function addSubPanelDomain(\App\Entity\Website\Domains\Domain $subPanelDomain): static
  510.     {
  511.         if (!$this->subPanelDomains->contains($subPanelDomain)) {
  512.             $this->subPanelDomains->add($subPanelDomain);
  513.             $subPanelDomain->setWebsite($this);
  514.         }
  515.         return $this;
  516.     }
  517.     public function removeSubPanelDomain(\App\Entity\Website\Domains\Domain $subPanelDomain): static
  518.     {
  519.         if ($this->subPanelDomains->removeElement($subPanelDomain)) {
  520.             // set the owning side to null (unless already changed)
  521.             if ($subPanelDomain->getWebsite() === $this) {
  522.                 $subPanelDomain->setWebsite(null);
  523.             }
  524.         }
  525.         return $this;
  526.     }
  527.     /**
  528.      * @return Collection<int, SmsIncome>
  529.      */
  530.     public function getSmsIncomes(): Collection
  531.     {
  532.         return $this->smsIncomes;
  533.     }
  534.     public function addSmsIncome(SmsIncome $smsIncome): static
  535.     {
  536.         if (!$this->smsIncomes->contains($smsIncome)) {
  537.             $this->smsIncomes->add($smsIncome);
  538.             $smsIncome->setWebsite($this);
  539.         }
  540.         return $this;
  541.     }
  542.     public function removeSmsIncome(SmsIncome $smsIncome): static
  543.     {
  544.         if ($this->smsIncomes->removeElement($smsIncome)) {
  545.             // set the owning side to null (unless already changed)
  546.             if ($smsIncome->getWebsite() === $this) {
  547.                 $smsIncome->setWebsite(null);
  548.             }
  549.         }
  550.         return $this;
  551.     }
  552.     /**
  553.      * @return Collection<int, VasetPal>
  554.      */
  555.     public function getVasetPals(): Collection
  556.     {
  557.         return $this->vasetPals;
  558.     }
  559.     public function addVasetPal(VasetPal $vasetPal): static
  560.     {
  561.         if (!$this->vasetPals->contains($vasetPal)) {
  562.             $this->vasetPals->add($vasetPal);
  563.             $vasetPal->setWebsite($this);
  564.         }
  565.         return $this;
  566.     }
  567.     public function removeVasetPal(VasetPal $vasetPal): static
  568.     {
  569.         if ($this->vasetPals->removeElement($vasetPal)) {
  570.             // set the owning side to null (unless already changed)
  571.             if ($vasetPal->getWebsite() === $this) {
  572.                 $vasetPal->setWebsite(null);
  573.             }
  574.         }
  575.         return $this;
  576.     }
  577.     /**
  578.      * @return Collection<int, Bot>
  579.      */
  580.     public function getBots(): Collection
  581.     {
  582.         return $this->bots;
  583.     }
  584.     public function addBot(Bot $bot): static
  585.     {
  586.         if (!$this->bots->contains($bot)) {
  587.             $this->bots->add($bot);
  588.             $bot->setWebsite($this);
  589.         }
  590.         return $this;
  591.     }
  592.     public function removeBot(Bot $bot): static
  593.     {
  594.         if ($this->bots->removeElement($bot)) {
  595.             // set the owning side to null (unless already changed)
  596.             if ($bot->getWebsite() === $this) {
  597.                 $bot->setWebsite(null);
  598.             }
  599.         }
  600.         return $this;
  601.     }
  602.     /**
  603.      * @return Collection<int, Analytics>
  604.      */
  605.     public function getAnalytics(): Collection
  606.     {
  607.         return $this->analytics;
  608.     }
  609.     public function addAnalytic(Analytics $analytic): static
  610.     {
  611.         if (!$this->analytics->contains($analytic)) {
  612.             $this->analytics->add($analytic);
  613.             $analytic->setWebsite($this);
  614.         }
  615.         return $this;
  616.     }
  617.     public function removeAnalytic(Analytics $analytic): static
  618.     {
  619.         if ($this->analytics->removeElement($analytic)) {
  620.             // set the owning side to null (unless already changed)
  621.             if ($analytic->getWebsite() === $this) {
  622.                 $analytic->setWebsite(null);
  623.             }
  624.         }
  625.         return $this;
  626.     }
  627.     /**
  628.      * @return Collection<int, Campaign>
  629.      */
  630.     public function getCampaigns(): Collection
  631.     {
  632.         return $this->campaigns;
  633.     }
  634.     public function addCampaign(Campaign $campaign): static
  635.     {
  636.         if (!$this->campaigns->contains($campaign)) {
  637.             $this->campaigns->add($campaign);
  638.             $campaign->setWebsite($this);
  639.         }
  640.         return $this;
  641.     }
  642.     public function removeCampaign(Campaign $campaign): static
  643.     {
  644.         if ($this->campaigns->removeElement($campaign)) {
  645.             // set the owning side to null (unless already changed)
  646.             if ($campaign->getWebsite() === $this) {
  647.                 $campaign->setWebsite(null);
  648.             }
  649.         }
  650.         return $this;
  651.     }
  652.     /**
  653.      * @return Collection<int, Cost>
  654.      */
  655.     public function getCosts(): Collection
  656.     {
  657.         return $this->costs;
  658.     }
  659.     public function addCost(Cost $cost): static
  660.     {
  661.         if (!$this->costs->contains($cost)) {
  662.             $this->costs->add($cost);
  663.             $cost->setWebsite($this);
  664.         }
  665.         return $this;
  666.     }
  667.     public function removeCost(Cost $cost): static
  668.     {
  669.         if ($this->costs->removeElement($cost)) {
  670.             // set the owning side to null (unless already changed)
  671.             if ($cost->getWebsite() === $this) {
  672.                 $cost->setWebsite(null);
  673.             }
  674.         }
  675.         return $this;
  676.     }
  677.     /**
  678.      * @return Collection<int, CostCategory>
  679.      */
  680.     public function getCostCategories(): Collection
  681.     {
  682.         return $this->costCategories;
  683.     }
  684.     public function addCostCategory(CostCategory $costCategory): static
  685.     {
  686.         if (!$this->costCategories->contains($costCategory)) {
  687.             $this->costCategories->add($costCategory);
  688.             $costCategory->setWebsite($this);
  689.         }
  690.         return $this;
  691.     }
  692.     public function removeCostCategory(CostCategory $costCategory): static
  693.     {
  694.         if ($this->costCategories->removeElement($costCategory)) {
  695.             // set the owning side to null (unless already changed)
  696.             if ($costCategory->getWebsite() === $this) {
  697.                 $costCategory->setWebsite(null);
  698.             }
  699.         }
  700.         return $this;
  701.     }
  702.     /**
  703.      * @return Collection<int, Transaction>
  704.      */
  705.     public function getWebsiteTransactions(): Collection
  706.     {
  707.         return $this->websiteTransactions;
  708.     }
  709.     public function addWebsiteTransaction(Transaction $websiteTransaction): static
  710.     {
  711.         if (!$this->websiteTransactions->contains($websiteTransaction)) {
  712.             $this->websiteTransactions->add($websiteTransaction);
  713.             $websiteTransaction->setWebsite($this);
  714.         }
  715.         return $this;
  716.     }
  717.     public function removeWebsiteTransaction(Transaction $websiteTransaction): static
  718.     {
  719.         if ($this->websiteTransactions->removeElement($websiteTransaction)) {
  720.             // set the owning side to null (unless already changed)
  721.             if ($websiteTransaction->getWebsite() === $this) {
  722.                 $websiteTransaction->setWebsite(null);
  723.             }
  724.         }
  725.         return $this;
  726.     }
  727.     /**
  728.      * @return Collection<int, Service>
  729.      */
  730.     public function getServices(): Collection
  731.     {
  732.         return $this->services;
  733.     }
  734.     public function addService(Service $service): static
  735.     {
  736.         if (!$this->services->contains($service)) {
  737.             $this->services->add($service);
  738.             $service->setWebsite($this);
  739.         }
  740.         return $this;
  741.     }
  742.     public function removeService(Service $service): static
  743.     {
  744.         if ($this->services->removeElement($service)) {
  745.             // set the owning side to null (unless already changed)
  746.             if ($service->getWebsite() === $this) {
  747.                 $service->setWebsite(null);
  748.             }
  749.         }
  750.         return $this;
  751.     }
  752.     /**
  753.      * @return Collection<int, Server>
  754.      */
  755.     public function getServers(): Collection
  756.     {
  757.         return $this->servers;
  758.     }
  759.     public function addServer(Server $server): static
  760.     {
  761.         if (!$this->servers->contains($server)) {
  762.             $this->servers->add($server);
  763.             $server->setWebsite($this);
  764.         }
  765.         return $this;
  766.     }
  767.     public function removeServer(Server $server): static
  768.     {
  769.         if ($this->servers->removeElement($server)) {
  770.             // set the owning side to null (unless already changed)
  771.             if ($server->getWebsite() === $this) {
  772.                 $server->setWebsite(null);
  773.             }
  774.         }
  775.         return $this;
  776.     }
  777.     /**
  778.      * @return Collection<int, \App\Entity\Website\VPN\OpenVPN\Server>
  779.      */
  780.     public function getOpenVPNServers(): Collection
  781.     {
  782.         return $this->openVPNServers;
  783.     }
  784.     public function addOpenVPNServer(\App\Entity\Website\VPN\OpenVPN\Server $openVPNServer): static
  785.     {
  786.         if (!$this->openVPNServers->contains($openVPNServer)) {
  787.             $this->openVPNServers->add($openVPNServer);
  788.             $openVPNServer->setWebsite($this);
  789.         }
  790.         return $this;
  791.     }
  792.     public function removeOpenVPNServer(\App\Entity\Website\VPN\OpenVPN\Server $openVPNServer): static
  793.     {
  794.         if ($this->openVPNServers->removeElement($openVPNServer)) {
  795.             // set the owning side to null (unless already changed)
  796.             if ($openVPNServer->getWebsite() === $this) {
  797.                 $openVPNServer->setWebsite(null);
  798.             }
  799.         }
  800.         return $this;
  801.     }
  802.     /**
  803.      * @return Collection<int, \App\Entity\Website\VPN\Service\Plan>
  804.      */
  805.     public function getPlans(): Collection
  806.     {
  807.         return $this->plans;
  808.     }
  809.     public function addPlan(\App\Entity\Website\VPN\Service\Plan $plan): static
  810.     {
  811.         if (!$this->plans->contains($plan)) {
  812.             $this->plans->add($plan);
  813.             $plan->setWebsite($this);
  814.         }
  815.         return $this;
  816.     }
  817.     public function removePlan(\App\Entity\Website\VPN\Service\Plan $plan): static
  818.     {
  819.         if ($this->plans->removeElement($plan)) {
  820.             // set the owning side to null (unless already changed)
  821.             if ($plan->getWebsite() === $this) {
  822.                 $plan->setWebsite(null);
  823.             }
  824.         }
  825.         return $this;
  826.     }
  827.     /**
  828.      * @return Collection<int, \App\Entity\Website\VPN\V2ray\Server>
  829.      */
  830.     public function getV2rayServers(): Collection
  831.     {
  832.         return $this->v2rayServers;
  833.     }
  834.     public function addV2rayServer(\App\Entity\Website\VPN\V2ray\Server $v2rayServer): static
  835.     {
  836.         if (!$this->v2rayServers->contains($v2rayServer)) {
  837.             $this->v2rayServers->add($v2rayServer);
  838.             $v2rayServer->setWebsite($this);
  839.         }
  840.         return $this;
  841.     }
  842.     public function removeV2rayServer(\App\Entity\Website\VPN\V2ray\Server $v2rayServer): static
  843.     {
  844.         if ($this->v2rayServers->removeElement($v2rayServer)) {
  845.             // set the owning side to null (unless already changed)
  846.             if ($v2rayServer->getWebsite() === $this) {
  847.                 $v2rayServer->setWebsite(null);
  848.             }
  849.         }
  850.         return $this;
  851.     }
  852. }