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.     /** @var CurrencyInterface|null */
  22.     protected $baseCurrency;
  23.     /** @var LocaleInterface|null */
  24.     protected $defaultLocale;
  25.     /** @var ZoneInterface|null */
  26.     protected $defaultTaxZone;
  27.     /** @var string|null */
  28.     protected $taxCalculationStrategy;
  29.     /**
  30.      * @var Collection|CurrencyInterface[]
  31.      *
  32.      * @psalm-var Collection<array-key, CurrencyInterface>
  33.      */
  34.     protected $currencies;
  35.     /**
  36.      * @var Collection|LocaleInterface[]
  37.      *
  38.      * @psalm-var Collection<array-key, LocaleInterface>
  39.      */
  40.     protected $locales;
  41.     /**
  42.      * @var Collection|CountryInterface[]
  43.      *
  44.      * @psalm-var Collection<array-key, CountryInterface>
  45.      */
  46.     protected $countries;
  47.     /** @var string|null */
  48.     protected $themeName;
  49.     /** @var string|null */
  50.     protected $contactEmail;
  51.     /** @var string|null */
  52.     protected $contactPhoneNumber;
  53.     /** @var bool */
  54.     protected $skippingShippingStepAllowed false;
  55.     /** @var bool */
  56.     protected $skippingPaymentStepAllowed false;
  57.     /** @var bool */
  58.     protected $accountVerificationRequired true;
  59.     /** @var ShopBillingDataInterface|null */
  60.     protected $shopBillingData;
  61.     /** @var TaxonInterface|null */
  62.     protected $menuTaxon;
  63.     public function __construct()
  64.     {
  65.         parent::__construct();
  66.         /** @var ArrayCollection<array-key, CurrencyInterface> $this->currencies */
  67.         $this->currencies = new ArrayCollection();
  68.         /** @var ArrayCollection<array-key, LocaleInterface> $this->locales */
  69.         $this->locales = new ArrayCollection();
  70.         /** @var ArrayCollection<array-key, CountryInterface> $this->countries */
  71.         $this->countries = new ArrayCollection();
  72.     }
  73.     public function getBaseCurrency(): ?CurrencyInterface
  74.     {
  75.         return $this->baseCurrency;
  76.     }
  77.     public function setBaseCurrency(?CurrencyInterface $currency): void
  78.     {
  79.         $this->baseCurrency $currency;
  80.     }
  81.     public function getDefaultLocale(): ?LocaleInterface
  82.     {
  83.         return $this->defaultLocale;
  84.     }
  85.     public function setDefaultLocale(?LocaleInterface $locale): void
  86.     {
  87.         $this->defaultLocale $locale;
  88.     }
  89.     public function getDefaultTaxZone(): ?ZoneInterface
  90.     {
  91.         return $this->defaultTaxZone;
  92.     }
  93.     public function setDefaultTaxZone(?ZoneInterface $defaultTaxZone): void
  94.     {
  95.         $this->defaultTaxZone $defaultTaxZone;
  96.     }
  97.     public function getTaxCalculationStrategy(): ?string
  98.     {
  99.         return $this->taxCalculationStrategy;
  100.     }
  101.     public function setTaxCalculationStrategy(?string $taxCalculationStrategy): void
  102.     {
  103.         $this->taxCalculationStrategy $taxCalculationStrategy;
  104.     }
  105.     public function getCurrencies(): Collection
  106.     {
  107.         return $this->currencies;
  108.     }
  109.     public function addCurrency(CurrencyInterface $currency): void
  110.     {
  111.         if (!$this->hasCurrency($currency)) {
  112.             $this->currencies->add($currency);
  113.         }
  114.     }
  115.     public function removeCurrency(CurrencyInterface $currency): void
  116.     {
  117.         if ($this->hasCurrency($currency)) {
  118.             $this->currencies->removeElement($currency);
  119.         }
  120.     }
  121.     public function hasCurrency(CurrencyInterface $currency): bool
  122.     {
  123.         return $this->currencies->contains($currency);
  124.     }
  125.     public function getLocales(): Collection
  126.     {
  127.         return $this->locales;
  128.     }
  129.     public function addLocale(LocaleInterface $locale): void
  130.     {
  131.         if (!$this->hasLocale($locale)) {
  132.             $this->locales->add($locale);
  133.         }
  134.     }
  135.     public function removeLocale(LocaleInterface $locale): void
  136.     {
  137.         if ($this->hasLocale($locale)) {
  138.             $this->locales->removeElement($locale);
  139.         }
  140.     }
  141.     public function hasLocale(LocaleInterface $locale): bool
  142.     {
  143.         return $this->locales->contains($locale);
  144.     }
  145.     public function getCountries(): Collection
  146.     {
  147.         return $this->countries;
  148.     }
  149.     public function addCountry(CountryInterface $country): void
  150.     {
  151.         if (!$this->hasCountry($country)) {
  152.             $this->countries->add($country);
  153.         }
  154.     }
  155.     public function removeCountry(CountryInterface $country): void
  156.     {
  157.         if ($this->hasCountry($country)) {
  158.             $this->countries->removeElement($country);
  159.         }
  160.     }
  161.     public function hasCountry(CountryInterface $country): bool
  162.     {
  163.         return $this->countries->contains($country);
  164.     }
  165.     public function getThemeName(): ?string
  166.     {
  167.         return $this->themeName;
  168.     }
  169.     public function setThemeName(?string $themeName): void
  170.     {
  171.         $this->themeName $themeName;
  172.     }
  173.     public function getContactEmail(): ?string
  174.     {
  175.         return $this->contactEmail;
  176.     }
  177.     public function setContactEmail(?string $contactEmail): void
  178.     {
  179.         $this->contactEmail $contactEmail;
  180.     }
  181.     public function getContactPhoneNumber(): ?string
  182.     {
  183.         return $this->contactPhoneNumber;
  184.     }
  185.     public function setContactPhoneNumber(?string $contactPhoneNumber): void
  186.     {
  187.         $this->contactPhoneNumber $contactPhoneNumber;
  188.     }
  189.     public function isSkippingShippingStepAllowed(): bool
  190.     {
  191.         return $this->skippingShippingStepAllowed;
  192.     }
  193.     public function setSkippingShippingStepAllowed(bool $skippingShippingStepAllowed): void
  194.     {
  195.         $this->skippingShippingStepAllowed $skippingShippingStepAllowed;
  196.     }
  197.     public function isSkippingPaymentStepAllowed(): bool
  198.     {
  199.         return $this->skippingPaymentStepAllowed;
  200.     }
  201.     public function setSkippingPaymentStepAllowed(bool $skippingPaymentStepAllowed): void
  202.     {
  203.         $this->skippingPaymentStepAllowed $skippingPaymentStepAllowed;
  204.     }
  205.     public function isAccountVerificationRequired(): bool
  206.     {
  207.         return $this->accountVerificationRequired;
  208.     }
  209.     public function setAccountVerificationRequired(bool $accountVerificationRequired): void
  210.     {
  211.         $this->accountVerificationRequired $accountVerificationRequired;
  212.     }
  213.     public function getShopBillingData(): ?ShopBillingDataInterface
  214.     {
  215.         return $this->shopBillingData;
  216.     }
  217.     public function setShopBillingData(ShopBillingDataInterface $shopBillingData): void
  218.     {
  219.         $this->shopBillingData $shopBillingData;
  220.     }
  221.     public function getMenuTaxon(): ?TaxonInterface
  222.     {
  223.         return $this->menuTaxon;
  224.     }
  225.     public function setMenuTaxon(?TaxonInterface $menuTaxon): void
  226.     {
  227.         $this->menuTaxon $menuTaxon;
  228.     }
  229. }