vendor/sylius/sylius/src/Sylius/Component/Core/Model/Channel.php line 24

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Sylius package.
  4.  *
  5.  * (c) Paweł Jędrzejewski
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. declare(strict_types=1);
  11. namespace Sylius\Component\Core\Model;
  12. use Doctrine\Common\Collections\ArrayCollection;
  13. use Doctrine\Common\Collections\Collection;
  14. use Sylius\Component\Addressing\Model\CountryInterface;
  15. use Sylius\Component\Addressing\Model\ZoneInterface;
  16. use Sylius\Component\Channel\Model\Channel as BaseChannel;
  17. use Sylius\Component\Currency\Model\CurrencyInterface;
  18. use Sylius\Component\Locale\Model\LocaleInterface;
  19. class Channel extends BaseChannel implements ChannelInterface
  20. {
  21.     /**
  22.      * @var CurrencyInterface|null
  23.      */
  24.     protected $baseCurrency;
  25.     /**
  26.      * @var LocaleInterface|null
  27.      */
  28.     protected $defaultLocale;
  29.     /**
  30.      * @var ZoneInterface|null
  31.      */
  32.     protected $defaultTaxZone;
  33.     /**
  34.      * @var string|null
  35.      */
  36.     protected $taxCalculationStrategy;
  37.     /**
  38.      * @var Collection|CurrencyInterface[]
  39.      *
  40.      * @psalm-var Collection<array-key, CurrencyInterface>
  41.      */
  42.     protected $currencies;
  43.     /**
  44.      * @var Collection|LocaleInterface[]
  45.      *
  46.      * @psalm-var Collection<array-key, LocaleInterface>
  47.      */
  48.     protected $locales;
  49.     /**
  50.      * @var Collection|CountryInterface[]
  51.      *
  52.      * @psalm-var Collection<array-key, CountryInterface>
  53.      */
  54.     protected $countries;
  55.     /**
  56.      * @var string|null
  57.      */
  58.     protected $themeName;
  59.     /**
  60.      * @var string|null
  61.      */
  62.     protected $contactEmail;
  63.     /**
  64.      * @var string|null
  65.      */
  66.     protected $contactPhoneNumber;
  67.     /**
  68.      * @var bool
  69.      */
  70.     protected $skippingShippingStepAllowed false;
  71.     /**
  72.      * @var bool
  73.      */
  74.     protected $skippingPaymentStepAllowed false;
  75.     /**
  76.      * @var bool
  77.      */
  78.     protected $accountVerificationRequired true;
  79.     /**
  80.      * @var ShopBillingDataInterface|null
  81.      */
  82.     protected $shopBillingData;
  83.     /**
  84.      * @var TaxonInterface|null
  85.      */
  86.     protected $menuTaxon;
  87.     public function __construct()
  88.     {
  89.         parent::__construct();
  90.         /** @var ArrayCollection<array-key, CurrencyInterface> $this->currencies */
  91.         $this->currencies = new ArrayCollection();
  92.         /** @var ArrayCollection<array-key, LocaleInterface> $this->locales */
  93.         $this->locales = new ArrayCollection();
  94.         /** @var ArrayCollection<array-key, CountryInterface> $this->countries */
  95.         $this->countries = new ArrayCollection();
  96.     }
  97.     public function getBaseCurrency(): ?CurrencyInterface
  98.     {
  99.         return $this->baseCurrency;
  100.     }
  101.     public function setBaseCurrency(?CurrencyInterface $currency): void
  102.     {
  103.         $this->baseCurrency $currency;
  104.     }
  105.     public function getDefaultLocale(): ?LocaleInterface
  106.     {
  107.         return $this->defaultLocale;
  108.     }
  109.     public function setDefaultLocale(?LocaleInterface $locale): void
  110.     {
  111.         $this->defaultLocale $locale;
  112.     }
  113.     public function getDefaultTaxZone(): ?ZoneInterface
  114.     {
  115.         return $this->defaultTaxZone;
  116.     }
  117.     public function setDefaultTaxZone(?ZoneInterface $defaultTaxZone): void
  118.     {
  119.         $this->defaultTaxZone $defaultTaxZone;
  120.     }
  121.     public function getTaxCalculationStrategy(): ?string
  122.     {
  123.         return $this->taxCalculationStrategy;
  124.     }
  125.     public function setTaxCalculationStrategy(?string $taxCalculationStrategy): void
  126.     {
  127.         $this->taxCalculationStrategy $taxCalculationStrategy;
  128.     }
  129.     public function getCurrencies(): Collection
  130.     {
  131.         return $this->currencies;
  132.     }
  133.     public function addCurrency(CurrencyInterface $currency): void
  134.     {
  135.         if (!$this->hasCurrency($currency)) {
  136.             $this->currencies->add($currency);
  137.         }
  138.     }
  139.     public function removeCurrency(CurrencyInterface $currency): void
  140.     {
  141.         if ($this->hasCurrency($currency)) {
  142.             $this->currencies->removeElement($currency);
  143.         }
  144.     }
  145.     public function hasCurrency(CurrencyInterface $currency): bool
  146.     {
  147.         return $this->currencies->contains($currency);
  148.     }
  149.     public function getLocales(): Collection
  150.     {
  151.         return $this->locales;
  152.     }
  153.     public function addLocale(LocaleInterface $locale): void
  154.     {
  155.         if (!$this->hasLocale($locale)) {
  156.             $this->locales->add($locale);
  157.         }
  158.     }
  159.     public function removeLocale(LocaleInterface $locale): void
  160.     {
  161.         if ($this->hasLocale($locale)) {
  162.             $this->locales->removeElement($locale);
  163.         }
  164.     }
  165.     public function hasLocale(LocaleInterface $locale): bool
  166.     {
  167.         return $this->locales->contains($locale);
  168.     }
  169.     public function getCountries(): Collection
  170.     {
  171.         return $this->countries;
  172.     }
  173.     public function addCountry(CountryInterface $country): void
  174.     {
  175.         if (!$this->hasCountry($country)) {
  176.             $this->countries->add($country);
  177.         }
  178.     }
  179.     public function removeCountry(CountryInterface $country): void
  180.     {
  181.         if ($this->hasCountry($country)) {
  182.             $this->countries->removeElement($country);
  183.         }
  184.     }
  185.     public function hasCountry(CountryInterface $country): bool
  186.     {
  187.         return $this->countries->contains($country);
  188.     }
  189.     public function getThemeName(): ?string
  190.     {
  191.         return $this->themeName;
  192.     }
  193.     public function setThemeName(?string $themeName): void
  194.     {
  195.         $this->themeName $themeName;
  196.     }
  197.     public function getContactEmail(): ?string
  198.     {
  199.         return $this->contactEmail;
  200.     }
  201.     public function setContactEmail(?string $contactEmail): void
  202.     {
  203.         $this->contactEmail $contactEmail;
  204.     }
  205.     public function getContactPhoneNumber(): ?string
  206.     {
  207.         return $this->contactPhoneNumber;
  208.     }
  209.     public function setContactPhoneNumber(?string $contactPhoneNumber): void
  210.     {
  211.         $this->contactPhoneNumber $contactPhoneNumber;
  212.     }
  213.     public function isSkippingShippingStepAllowed(): bool
  214.     {
  215.         return $this->skippingShippingStepAllowed;
  216.     }
  217.     public function setSkippingShippingStepAllowed(bool $skippingShippingStepAllowed): void
  218.     {
  219.         $this->skippingShippingStepAllowed $skippingShippingStepAllowed;
  220.     }
  221.     public function isSkippingPaymentStepAllowed(): bool
  222.     {
  223.         return $this->skippingPaymentStepAllowed;
  224.     }
  225.     public function setSkippingPaymentStepAllowed(bool $skippingPaymentStepAllowed): void
  226.     {
  227.         $this->skippingPaymentStepAllowed $skippingPaymentStepAllowed;
  228.     }
  229.     public function isAccountVerificationRequired(): bool
  230.     {
  231.         return $this->accountVerificationRequired;
  232.     }
  233.     public function setAccountVerificationRequired(bool $accountVerificationRequired): void
  234.     {
  235.         $this->accountVerificationRequired $accountVerificationRequired;
  236.     }
  237.     public function getShopBillingData(): ?ShopBillingDataInterface
  238.     {
  239.         return $this->shopBillingData;
  240.     }
  241.     public function setShopBillingData(ShopBillingDataInterface $shopBillingData): void
  242.     {
  243.         $this->shopBillingData $shopBillingData;
  244.     }
  245.     public function getMenuTaxon(): ?TaxonInterface
  246.     {
  247.         return $this->menuTaxon;
  248.     }
  249.     public function setMenuTaxon(?TaxonInterface $menuTaxon): void
  250.     {
  251.         $this->menuTaxon $menuTaxon;
  252.     }
  253. }