src/Entity/Shop/Shop/Shop.php line 41

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