src/Entity/Website/Website/Website.php line 43

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