src/Entity/Website/Website/Website.php line 27

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