vendor/coreshop/core-shop/src/CoreShop/Component/Core/Model/Country.php line 27

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4.  * CoreShop
  5.  *
  6.  * This source file is available under two different licenses:
  7.  *  - GNU General Public License version 3 (GPLv3)
  8.  *  - CoreShop Commercial License (CCL)
  9.  * Full copyright and license information is available in
  10.  * LICENSE.md which is distributed with this source code.
  11.  *
  12.  * @copyright  Copyright (c) CoreShop GmbH (https://www.coreshop.org)
  13.  * @license    https://www.coreshop.org/license     GPLv3 and CCL
  14.  *
  15.  */
  16. namespace CoreShop\Component\Core\Model;
  17. use CoreShop\Component\Address\Model\Country as BaseCountry;
  18. use CoreShop\Component\Store\Model\StoresAwareTrait;
  19. /**
  20.  * @psalm-suppress MissingConstructor
  21.  */
  22. class Country extends BaseCountry implements CountryInterface
  23. {
  24.     use StoresAwareTrait {
  25.         __construct as storesAwareConstructor;
  26.     }
  27.     /**
  28.      * @var CurrencyInterface
  29.      */
  30.     protected $currency;
  31.     public function __construct(
  32.         ) {
  33.         parent::__construct();
  34.         $this->storesAwareConstructor();
  35.     }
  36.     public function getCurrency()
  37.     {
  38.         return $this->currency;
  39.     }
  40.     public function setCurrency(CurrencyInterface $currency null)
  41.     {
  42.         $this->currency $currency;
  43.         if (null !== $currency) {
  44.             $currency->addCountry($this);
  45.         }
  46.         return $this;
  47.     }
  48.     /**
  49.      * @return string
  50.      */
  51.     public function __toString()
  52.     {
  53.         return sprintf('%s'$this->getIsoCode());
  54.     }
  55. }