Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
Store Class Reference
Inheritance diagram for Store:
AbstractExtensibleModel ScopeInterface ScopeInterface IdentityInterface StoreInterface AbstractModel CustomAttributesDataInterface ScopeInterface ExtensibleDataInterface DataObject ExtensibleDataInterface

Public Member Functions

 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory, \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory, \Magento\Store\Model\ResourceModel\Store $resource, \Magento\MediaStorage\Helper\File\Storage\Database $coreFileStorageDatabase, \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\Framework\UrlInterface $url, \Magento\Framework\App\RequestInterface $request, \Magento\Config\Model\ResourceModel\Config\Data $configDataResource, \Magento\Framework\Filesystem $filesystem, \Magento\Framework\App\Config\ReinitableConfigInterface $config, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Session\SidResolverInterface $sidResolver, \Magento\Framework\App\Http\Context $httpContext, \Magento\Framework\Session\SessionManagerInterface $session, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Store\Model\Information $information, $currencyInstalled, \Magento\Store\Api\GroupRepositoryInterface $groupRepository, \Magento\Store\Api\WebsiteRepositoryInterface $websiteRepository, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, $isCustomEntryPoint=false, array $data=[], \Magento\Framework\Event\ManagerInterface $eventManager=null)
 
 __sleep ()
 
 __wakeup ()
 
 load ($key, $field=null)
 
 getCode ()
 
 setCode ($code)
 
 getName ()
 
 setName ($name)
 
 getConfig ($path)
 
 setWebsite (Website $website)
 
 getWebsite ()
 
 getBaseUrl ($type=UrlInterface::URL_TYPE_LINK, $secure=null)
 
 getBaseMediaDir ()
 
 getBaseStaticDir ()
 
 isUseStoreInUrl ()
 
 getId ()
 
 isFrontUrlSecure ()
 
 isUrlSecure ()
 
 isCurrentlySecure ()
 
 getBaseCurrencyCode ()
 
 getBaseCurrency ()
 
 getDefaultCurrencyCode ()
 
 getDefaultCurrency ()
 
 setCurrentCurrencyCode ($code)
 
 getCurrentCurrencyCode ()
 
 getAvailableCurrencyCodes ($skipBaseNotAllowed=false)
 
 getAllowedCurrencies ()
 
 getCurrentCurrency ()
 
 getCurrentCurrencyRate ()
 
 getRootCategoryId ()
 
 setGroup (Group $group)
 
 getGroup ()
 
 getWebsiteId ()
 
 afterSave ()
 
 setWebsiteId ($websiteId)
 
 getGroupId ()
 
 getStoreGroupId ()
 
 setStoreGroupId ($storeGroupId)
 
 getIsActive ()
 
 setIsActive ($isActive)
 
 getDefaultGroupId ()
 
 isCanDelete ()
 
 isDefault ()
 
 getCurrentUrl ($fromStore=true)
 
 isActive ()
 
 beforeDelete ()
 
 afterDelete ()
 
 resetConfig ()
 
 isReadOnly ($value=null)
 
 getFrontendName ()
 
 getFormattedAddress ()
 
 getIdentities ()
 
 getStorePath ()
 
 getScopeType ()
 
 getScopeTypeName ()
 
 getExtensionAttributes ()
 
 setExtensionAttributes (\Magento\Store\Api\Data\StoreExtensionInterface $extensionAttributes)
 
- Public Member Functions inherited from AbstractExtensibleModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, ExtensionAttributesFactory $extensionFactory, AttributeValueFactory $customAttributeFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 getCustomAttributes ()
 
 getCustomAttribute ($attributeCode)
 
 setCustomAttributes (array $attributes)
 
 setCustomAttribute ($attributeCode, $attributeValue)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 setId ($value)
 
 __sleep ()
 
 __wakeup ()
 
- Public Member Functions inherited from AbstractModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 __sleep ()
 
 __wakeup ()
 
 setIdFieldName ($name)
 
 getIdFieldName ()
 
 getId ()
 
 setId ($value)
 
 isDeleted ($isDeleted=null)
 
 hasDataChanges ()
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 setDataChanges ($value)
 
 getOrigData ($key=null)
 
 setOrigData ($key=null, $data=null)
 
 dataHasChangedFor ($field)
 
 getResourceName ()
 
 getResourceCollection ()
 
 getCollection ()
 
 load ($modelId, $field=null)
 
 beforeLoad ($identifier, $field=null)
 
 afterLoad ()
 
 isSaveAllowed ()
 
 setHasDataChanges ($flag)
 
 save ()
 
 afterCommitCallback ()
 
 isObjectNew ($flag=null)
 
 beforeSave ()
 
 validateBeforeSave ()
 
 getCacheTags ()
 
 cleanModelCache ()
 
 afterSave ()
 
 delete ()
 
 beforeDelete ()
 
 afterDelete ()
 
 afterDeleteCommit ()
 
 getResource ()
 
 getEntityId ()
 
 setEntityId ($entityId)
 
 clearInstance ()
 
 getStoredData ()
 
 getEventPrefix ()
 
- Public Member Functions inherited from DataObject
 __construct (array $data=[])
 
 addData (array $arr)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 getDataByPath ($path)
 
 getDataByKey ($key)
 
 setDataUsingMethod ($key, $args=[])
 
 getDataUsingMethod ($key, $args=null)
 
 hasData ($key='')
 
 toArray (array $keys=[])
 
 convertToArray (array $keys=[])
 
 toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 toJson (array $keys=[])
 
 convertToJson (array $keys=[])
 
 toString ($format='')
 
 __call ($method, $args)
 
 isEmpty ()
 
 serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
 
 debug ($data=null, &$objects=[])
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 offsetGet ($offset)
 
- Public Member Functions inherited from StoreInterface
 setId ($id)
 
 setExtensionAttributes (\Magento\Store\Api\Data\StoreExtensionInterface $extensionAttributes)
 

Data Fields

const STORE_ID = 'store_id'
 
const ENTITY = 'store'
 
const CUSTOM_ENTRY_POINT_PARAM = 'custom_entry_point'
 
const XML_PATH_STORE_IN_URL = 'web/url/use_store'
 
const XML_PATH_USE_REWRITES = 'web/seo/use_rewrites'
 
const XML_PATH_UNSECURE_BASE_URL = 'web/unsecure/base_url'
 
const XML_PATH_SECURE_BASE_URL = 'web/secure/base_url'
 
const XML_PATH_SECURE_IN_FRONTEND = 'web/secure/use_in_frontend'
 
const XML_PATH_SECURE_IN_ADMINHTML = 'web/secure/use_in_adminhtml'
 
const XML_PATH_ENABLE_HSTS = 'web/secure/enable_hsts'
 
const XML_PATH_ENABLE_UPGRADE_INSECURE = 'web/secure/enable_upgrade_insecure'
 
const XML_PATH_SECURE_BASE_LINK_URL = 'web/secure/base_link_url'
 
const XML_PATH_UNSECURE_BASE_LINK_URL = 'web/unsecure/base_link_url'
 
const XML_PATH_SECURE_BASE_STATIC_URL = 'web/secure/base_static_url'
 
const XML_PATH_UNSECURE_BASE_STATIC_URL = 'web/unsecure/base_static_url'
 
const XML_PATH_SECURE_BASE_MEDIA_URL = 'web/secure/base_media_url'
 
const XML_PATH_UNSECURE_BASE_MEDIA_URL = 'web/unsecure/base_media_url'
 
const XML_PATH_PRICE_SCOPE = 'catalog/price/scope'
 
const PRICE_SCOPE_GLOBAL = 0
 
const PRICE_SCOPE_WEBSITE = 1
 
const ADMIN_CODE = 'admin'
 
const CACHE_TAG = 'store'
 
const MEDIA_REWRITE_SCRIPT = 'get.php/'
 
const BASE_URL_PLACEHOLDER = '{{base_url}}'
 
const DEFAULT_STORE_ID = 0
 
const DISTRO_STORE_ID = 1
 
- Data Fields inherited from CustomAttributesDataInterface
const CUSTOM_ATTRIBUTES = 'custom_attributes'
 
- Data Fields inherited from ExtensibleDataInterface
const EXTENSION_ATTRIBUTES_KEY = 'extension_attributes'
 
- Data Fields inherited from ScopeInterface
const SCOPE_DEFAULT = 'default'
 

Protected Member Functions

 _construct ()
 
 _getSession ()
 
 _getValidationRulesBeforeSave ()
 
 _updatePathUseRewrites ($url)
 
 _isCustomEntryPoint ()
 
 _getMediaScriptUrl (Filesystem $filesystem, $secure)
 
 _updatePathUseStoreView ($url)
 
- Protected Member Functions inherited from AbstractExtensibleModel
 filterCustomAttributes ($data)
 
 initializeCustomAttributes ()
 
 convertCustomAttributeValues (array &$customAttributes)
 
 getCustomAttributesCodes ()
 
 _setExtensionAttributes (\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
 
 _getExtensionAttributes ()
 
- Protected Member Functions inherited from AbstractModel
 _construct ()
 
 _init ($resourceModel)
 
 _setResourceModel ($resourceName, $collectionName=null)
 
 _getResource ()
 
 _getEventData ()
 
 _beforeLoad ($modelId, $field=null)
 
 _afterLoad ()
 
 _hasModelChanged ()
 
 _getValidatorBeforeSave ()
 
 _createValidatorBeforeSave ()
 
 _getValidationRulesBeforeSave ()
 
 _clearReferences ()
 
 _clearData ()
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 

Protected Attributes

 $_configCacheType
 
 $_cacheTag = true
 
 $_eventPrefix = 'store'
 
 $_eventObject = 'store'
 
 $_priceFilter
 
 $_configCache = null
 
 $_configCacheBaseNodes = []
 
 $_dirCache = []
 
 $_urlCache = []
 
 $_baseUrlCache = []
 
 $_session
 
 $_isAdminSecure = null
 
 $_isFrontSecure = null
 
 $_frontendName = null
 
 $_url
 
 $_isCustomEntryPoint = false
 
 $_request
 
 $_configDataResource
 
 $_coreFileStorageDatabase = null
 
 $filesystem
 
 $_config
 
 $_sidResolver
 
 $_currencyInstalled
 
 $_httpContext
 
 $currencyFactory
 
 $groupRepository
 
 $websiteRepository
 
 $information
 
- Protected Attributes inherited from AbstractExtensibleModel
 $extensionAttributesFactory
 
 $extensionAttributes
 
 $customAttributeFactory
 
 $customAttributesCodes = null
 
 $customAttributesChanged = false
 
- Protected Attributes inherited from AbstractModel
 $_eventPrefix = 'core_abstract'
 
 $_eventObject = 'object'
 
 $_idFieldName = 'id'
 
 $_hasDataChanges = false
 
 $_origData
 
 $_isDeleted = false
 
 $_resource
 
 $_resourceCollection
 
 $_resourceName
 
 $_collectionName
 
 $_cacheTag = false
 
 $_dataSaveAllowed = true
 
 $_isObjectNew = null
 
 $_validatorBeforeSave = null
 
 $_eventManager
 
 $_cacheManager
 
 $_registry
 
 $_logger
 
 $_appState
 
 $_actionValidator
 
 $storedData = []
 
- Protected Attributes inherited from DataObject
 $_data = []
 

Additional Inherited Members

- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

Store model

@api @method Store setGroupId($value) @method int getSortOrder() @method int getStoreId() @method Store setSortOrder($value)

@SuppressWarnings(PHPMD.TooManyFields) @SuppressWarnings(PHPMD.ExcessiveClassComplexity) @SuppressWarnings(PHPMD.CouplingBetweenObjects) @SuppressWarnings(PHPMD.ExcessivePublicCount)

Since
100.0.2

Definition at line 38 of file Store.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\Model\Context  $context,
\Magento\Framework\Registry  $registry,
\Magento\Framework\Api\ExtensionAttributesFactory  $extensionFactory,
\Magento\Framework\Api\AttributeValueFactory  $customAttributeFactory,
\Magento\Store\Model\ResourceModel\Store  $resource,
\Magento\MediaStorage\Helper\File\Storage\Database  $coreFileStorageDatabase,
\Magento\Framework\App\Cache\Type\Config  $configCacheType,
\Magento\Framework\UrlInterface  $url,
\Magento\Framework\App\RequestInterface  $request,
\Magento\Config\Model\ResourceModel\Config\Data  $configDataResource,
\Magento\Framework\Filesystem  $filesystem,
\Magento\Framework\App\Config\ReinitableConfigInterface  $config,
\Magento\Store\Model\StoreManagerInterface  $storeManager,
\Magento\Framework\Session\SidResolverInterface  $sidResolver,
\Magento\Framework\App\Http\Context  $httpContext,
\Magento\Framework\Session\SessionManagerInterface  $session,
\Magento\Directory\Model\CurrencyFactory  $currencyFactory,
\Magento\Store\Model\Information  $information,
  $currencyInstalled,
\Magento\Store\Api\GroupRepositoryInterface  $groupRepository,
\Magento\Store\Api\WebsiteRepositoryInterface  $websiteRepository,
\Magento\Framework\Data\Collection\AbstractDb  $resourceCollection = null,
  $isCustomEntryPoint = false,
array  $data = [],
\Magento\Framework\Event\ManagerInterface  $eventManager = null 
)
Parameters
\Magento\Framework\Model\Context$context
\Magento\Framework\Registry$registry
\Magento\Framework\Api\ExtensionAttributesFactory$extensionFactory
\Magento\Framework\Api\AttributeValueFactory$customAttributeFactory
\Magento\Store\Model\ResourceModel\Store$resource
\Magento\MediaStorage\Helper\File\Storage\Database$coreFileStorageDatabase
\Magento\Framework\App\Cache\Type\Config$configCacheType
\Magento\Framework\UrlInterface$url
\Magento\Framework\App\RequestInterface$request
\Magento\Config\Model\ResourceModel\Config\Data$configDataResource
\Magento\Framework\Filesystem$filesystem
\Magento\Framework\App\Config\ReinitableConfigInterface$config
\Magento\Store\Model\StoreManagerInterface$storeManager
\Magento\Framework\Session\SidResolverInterface$sidResolver
\Magento\Framework\App\Http\Context$httpContext
\Magento\Framework\Session\SessionManagerInterface$session
\Magento\Directory\Model\CurrencyFactory$currencyFactory
Information$information
string$currencyInstalled
\Magento\Store\Api\GroupRepositoryInterface$groupRepository
\Magento\Store\Api\WebsiteRepositoryInterface$websiteRepository
\Magento\Framework\Data\Collection\AbstractDb$resourceCollection
bool$isCustomEntryPoint
array$dataoptional generic object data
\Magento\Framework\Event\ManagerInterface | null$eventManager@SuppressWarnings(PHPMD.ExcessiveParameterList)

Definition at line 357 of file Store.php.

383  {
384  $this->_coreFileStorageDatabase = $coreFileStorageDatabase;
385  $this->_config = $config;
386  $this->_url = $url;
387  $this->_configCacheType = $configCacheType;
388  $this->_request = $request;
389  $this->_configDataResource = $configDataResource;
390  $this->_isCustomEntryPoint = $isCustomEntryPoint;
391  $this->filesystem = $filesystem;
392  $this->_storeManager = $storeManager;
393  $this->_sidResolver = $sidResolver;
394  $this->_httpContext = $httpContext;
395  $this->_session = $session;
396  $this->currencyFactory = $currencyFactory;
397  $this->information = $information;
398  $this->_currencyInstalled = $currencyInstalled;
399  $this->groupRepository = $groupRepository;
400  $this->websiteRepository = $websiteRepository;
401  $this->eventManager = $eventManager ?: \Magento\Framework\App\ObjectManager::getInstance()
402  ->get(\Magento\Framework\Event\ManagerInterface::class);
403  parent::__construct(
404  $context,
405  $registry,
406  $extensionFactory,
408  $resource,
409  $resourceCollection,
410  $data
411  );
412  }
$config
Definition: fraud_order.php:17
$storeManager
$resource
Definition: bulk.php:12

Member Function Documentation

◆ __sleep()

__sleep ( )
Returns
string[]

Definition at line 417 of file Store.php.

418  {
420  $properties = array_diff($properties, ['_coreFileStorageDatabase', '_config']);
421  return $properties;
422  }
$properties
Definition: categories.php:26

◆ __wakeup()

__wakeup ( )

Init not serializable fields

Returns
void

Definition at line 429 of file Store.php.

430  {
432  $this->_coreFileStorageDatabase = ObjectManager::getInstance()
433  ->get(\Magento\MediaStorage\Helper\File\Storage\Database::class);
434  $this->_config = ObjectManager::getInstance()->get(
435  \Magento\Framework\App\Config\ReinitableConfigInterface::class
436  );
437  }

◆ _construct()

_construct ( )
protected

Initialize object

Returns
void

Definition at line 444 of file Store.php.

445  {
446  $this->_init(\Magento\Store\Model\ResourceModel\Store::class);
447  }

◆ _getMediaScriptUrl()

_getMediaScriptUrl ( Filesystem  $filesystem,
  $secure 
)
protected

Retrieve URL for media catalog

If we use Database file storage and server doesn't support rewrites (.htaccess in media folder) we have to put name of fetching media script exactly into URL

Parameters
Filesystem$filesystem
bool$secure
Returns
string|bool

Definition at line 730 of file Store.php.

731  {
732  if (!$this->getConfig(self::XML_PATH_USE_REWRITES) && $this->_coreFileStorageDatabase->checkDbUsage()) {
733  $baseUrl = $this->getBaseUrl(UrlInterface::URL_TYPE_WEB, $secure);
734  return $baseUrl . $filesystem->getUri(DirectoryList::PUB) . '/' . self::MEDIA_REWRITE_SCRIPT;
735  }
736  return false;
737  }
getBaseUrl($type=UrlInterface::URL_TYPE_LINK, $secure=null)
Definition: Store.php:607

◆ _getSession()

_getSession ( )
protected

Retrieve store session object

Returns
\Magento\Framework\Session\SessionManagerInterface

Definition at line 454 of file Store.php.

455  {
456  if (!$this->_session->isSessionExists()) {
457  $this->_session->setName('store_' . $this->getCode());
458  $this->_session->start();
459  }
460  return $this->_session;
461  }

◆ _getValidationRulesBeforeSave()

_getValidationRulesBeforeSave ( )
protected

Validation rules for store

Returns
\Zend_Validate_Interface|null

Definition at line 468 of file Store.php.

469  {
470  $validator = new \Magento\Framework\Validator\DataObject();
471 
472  $storeLabelRule = new \Zend_Validate_NotEmpty();
473  $storeLabelRule->setMessage(__('Name is required'), \Zend_Validate_NotEmpty::IS_EMPTY);
474  $validator->addRule($storeLabelRule, 'name');
475 
476  $storeCodeRule = new \Zend_Validate_Regex('/^[a-z]+[a-z0-9_]*$/i');
477  $storeCodeRule->setMessage(
478  __(
479  'The store code may contain only letters (a-z), numbers (0-9) or underscore (_),'
480  . ' and the first character must be a letter.'
481  ),
483  );
484  $validator->addRule($storeCodeRule, 'code');
485 
486  return $validator;
487  }
__()
Definition: __.php:13

◆ _isCustomEntryPoint()

_isCustomEntryPoint ( )
protected

Check if used entry point is custom

Returns
bool

Definition at line 715 of file Store.php.

716  {
718  }

◆ _updatePathUseRewrites()

_updatePathUseRewrites (   $url)
protected

Append script file name to url in case when server rewrites are disabled

Parameters
string$url
Returns
string

Definition at line 697 of file Store.php.

698  {
699  if ($this->getForceDisableRewrites() || !$this->getConfig(self::XML_PATH_USE_REWRITES)) {
700  if ($this->_isCustomEntryPoint()) {
701  $indexFileName = 'index.php';
702  } else {
703  $indexFileName = basename($_SERVER['SCRIPT_FILENAME']);
704  }
705  $url .= $indexFileName . '/';
706  }
707  return $url;
708  }

◆ _updatePathUseStoreView()

_updatePathUseStoreView (   $url)
protected

Add store code to url in case if it is enabled in configuration

Parameters
string$url
Returns
string

Definition at line 745 of file Store.php.

746  {
747  if ($this->isUseStoreInUrl()) {
748  $url .= $this->getCode() . '/';
749  }
750  return $url;
751  }

◆ afterDelete()

afterDelete ( )

Rewrite in order to clear configuration cache

Returns
$this

Definition at line 1257 of file Store.php.

1258  {
1259  $store = $this;
1260  $this->getResource()->addCommitCallback(function () use ($store) {
1261  $this->_storeManager->reinitStores();
1262  $this->eventManager->dispatch($this->_eventPrefix . '_delete', ['store' => $store]);
1263  });
1264  parent::afterDelete();
1265  $this->_configCacheType->clean();
1266 
1267  if ($this->getId() === $this->getGroup()->getDefaultStoreId()) {
1268  $ids = $this->getGroup()->getStoreIds();
1269  if (!empty($ids) && count($ids) > 1) {
1270  unset($ids[$this->getId()]);
1271  $defaultId = current($ids);
1272  } else {
1273  $defaultId = null;
1274  }
1275  $this->getGroup()->setDefaultStoreId($defaultId);
1276  $this->getGroup()->save();
1277  }
1278 
1279  return $this;
1280  }

◆ afterSave()

afterSave ( )

Reinit Stores on after save

Deprecated:
100.1.3
Returns
$this
Since
100.1.3

Definition at line 1058 of file Store.php.

1059  {
1060  $this->_storeManager->reinitStores();
1061  if ($this->isObjectNew()) {
1062  $event = $this->_eventPrefix . '_add';
1063  } else {
1064  $event = $this->_eventPrefix . '_edit';
1065  }
1066  $store = $this;
1067  $this->getResource()->addCommitCallback(function () use ($event, $store) {
1068  $this->eventManager->dispatch($event, ['store' => $store]);
1069  });
1070  return parent::afterSave();
1071  }

◆ beforeDelete()

beforeDelete ( )

Protect delete from non admin area

Returns
$this

Definition at line 1246 of file Store.php.

1247  {
1248  $this->_configDataResource->clearScopeData(ScopeInterface::SCOPE_STORES, $this->getId());
1249  return parent::beforeDelete();
1250  }

◆ getAllowedCurrencies()

getAllowedCurrencies ( )

Array of installed currencies for the scope

Returns
array

Definition at line 966 of file Store.php.

967  {
968  return explode(',', $this->getConfig($this->_currencyInstalled));
969  }

◆ getAvailableCurrencyCodes()

getAvailableCurrencyCodes (   $skipBaseNotAllowed = false)

Get allowed store currency codes

If base currency is not allowed in current website config scope, then it can be disabled with $skipBaseNotAllowed

Parameters
bool$skipBaseNotAllowed
Returns
array

Definition at line 933 of file Store.php.

934  {
935  $codes = $this->getData('available_currency_codes');
936  if (null === $codes) {
937  $codes = explode(',', $this->getConfig(Currency::XML_PATH_CURRENCY_ALLOW));
938  // add base currency, if it is not in allowed currencies
939  $baseCurrencyCode = $this->getBaseCurrencyCode();
940  if (!in_array($baseCurrencyCode, $codes)) {
941  $codes[] = $baseCurrencyCode;
942 
943  // save base currency code index for further usage
944  $disallowedBaseCodeIndex = array_keys($codes);
945  $disallowedBaseCodeIndex = array_pop($disallowedBaseCodeIndex);
946  $this->setData('disallowed_base_currency_code_index', $disallowedBaseCodeIndex);
947  }
948  $this->setData('available_currency_codes', $codes);
949  }
950 
951  // remove base currency code, if it is not allowed by config (optional)
952  if ($skipBaseNotAllowed) {
953  $disallowedBaseCodeIndex = $this->getData('disallowed_base_currency_code_index');
954  if (null !== $disallowedBaseCodeIndex) {
955  unset($codes[$disallowedBaseCodeIndex]);
956  }
957  }
958  return $codes;
959  }

◆ getBaseCurrency()

getBaseCurrency ( )

Retrieve store base currency

Returns
Currency

Definition at line 844 of file Store.php.

845  {
846  $currency = $this->getData('base_currency');
847  if (null === $currency) {
848  $currency = $this->currencyFactory->create()->load($this->getBaseCurrencyCode());
849  $this->setData('base_currency', $currency);
850  }
851  return $currency;
852  }

◆ getBaseCurrencyCode()

getBaseCurrencyCode ( )

Retrieve store base currency code

Returns
string

Definition at line 830 of file Store.php.

831  {
832  $configValue = $this->getConfig(self::XML_PATH_PRICE_SCOPE);
833  if ($configValue == self::PRICE_SCOPE_GLOBAL) {
835  }
837  }

◆ getBaseMediaDir()

getBaseMediaDir ( )

Retrieve base media directory path

Returns
string

Definition at line 676 of file Store.php.

677  {
678  return $this->filesystem->getUri(DirectoryList::MEDIA);
679  }

◆ getBaseStaticDir()

getBaseStaticDir ( )

Retrieve base static directory path

Returns
string

Definition at line 686 of file Store.php.

687  {
688  return $this->filesystem->getUri(DirectoryList::STATIC_VIEW);
689  }

◆ getBaseUrl()

getBaseUrl (   $type = UrlInterface::URL_TYPE_LINK,
  $secure = null 
)

Retrieve base URL

Parameters
string$type
boolean | null$secure
Returns
string
Exceptions

Implements ScopeInterface.

Definition at line 607 of file Store.php.

608  {
609  $cacheKey = $type . '/' . ($secure === null ? 'null' : ($secure ? 'true' : 'false'));
610  if (!isset($this->_baseUrlCache[$cacheKey])) {
611  $secure = $secure === null ? $this->isCurrentlySecure() : (bool)$secure;
612  switch ($type) {
614  $path = $secure
617  $url = $this->getConfig($path);
618  break;
619 
622  $url = $this->getConfig($path);
623  $url = $this->_updatePathUseRewrites($url);
625  break;
626 
629  $url = $this->getConfig($path);
630  $url = $this->_updatePathUseRewrites($url);
631  break;
632 
635  $url = $this->getConfig($path);
636  if (!$url) {
637  $url = $this->getBaseUrl(UrlInterface::URL_TYPE_WEB, $secure)
638  . $this->filesystem->getUri(DirectoryList::STATIC_VIEW);
639  }
640  break;
641 
643  $url = $this->_getMediaScriptUrl($this->filesystem, $secure);
644  if (!$url) {
646  $url = $this->getConfig($path);
647  if (!$url) {
648  $url = $this->getBaseUrl(UrlInterface::URL_TYPE_WEB, $secure)
649  . $this->filesystem->getUri(DirectoryList::MEDIA);
650  }
651  }
652  break;
653 
654  default:
655  throw new \InvalidArgumentException('Invalid base url type');
656  }
657 
658  if (false !== strpos($url, self::BASE_URL_PLACEHOLDER)) {
659  $url = str_replace(self::BASE_URL_PLACEHOLDER, $this->_request->getDistroBaseUrl(), $url);
660  }
661 
662  $this->_baseUrlCache[$cacheKey] = $this->getUrlModifier()->execute(
663  rtrim($url, '/') . '/',
664  \Magento\Framework\Url\ModifierInterface::MODE_BASE
665  );
666  }
667 
668  return $this->_baseUrlCache[$cacheKey];
669  }
const XML_PATH_UNSECURE_BASE_STATIC_URL
Definition: Store.php:84
const XML_PATH_UNSECURE_BASE_URL
Definition: Store.php:66
const XML_PATH_SECURE_BASE_MEDIA_URL
Definition: Store.php:86
const XML_PATH_UNSECURE_BASE_MEDIA_URL
Definition: Store.php:88
$type
Definition: item.phtml:13
const XML_PATH_SECURE_BASE_LINK_URL
Definition: Store.php:78
_getMediaScriptUrl(Filesystem $filesystem, $secure)
Definition: Store.php:730
const XML_PATH_UNSECURE_BASE_LINK_URL
Definition: Store.php:80
const XML_PATH_SECURE_BASE_URL
Definition: Store.php:68
getBaseUrl($type=UrlInterface::URL_TYPE_LINK, $secure=null)
Definition: Store.php:607
const XML_PATH_SECURE_BASE_STATIC_URL
Definition: Store.php:82

◆ getCode()

getCode ( )

Retrieve Store code

Returns
string

Implements ScopeInterface.

Definition at line 510 of file Store.php.

511  {
512  return $this->_getData('code');
513  }

◆ getConfig()

getConfig (   $path)

Retrieve store configuration data

Parameters
string$path
Returns
string|null

Definition at line 545 of file Store.php.

546  {
547  $data = $this->_config->getValue($path, ScopeInterface::SCOPE_STORE, $this->getCode());
548  if ($data === null) {
549  $data = $this->_config->getValue($path);
550  }
551  return $data === false ? null : $data;
552  }

◆ getCurrentCurrency()

getCurrentCurrency ( )

Retrieve store current currency

Returns
Currency

Definition at line 976 of file Store.php.

977  {
978  $currency = $this->getData('current_currency');
979 
980  if ($currency === null) {
981  $currency = $this->currencyFactory->create()->load($this->getCurrentCurrencyCode());
982  $baseCurrency = $this->getBaseCurrency();
983 
984  if (!$baseCurrency->getRate($currency)) {
985  $currency = $baseCurrency;
986  $this->setCurrentCurrencyCode($baseCurrency->getCode());
987  }
988  $this->setData('current_currency', $currency);
989  }
990  return $currency;
991  }
setCurrentCurrencyCode($code)
Definition: Store.php:886

◆ getCurrentCurrencyCode()

getCurrentCurrencyCode ( )

Get current store currency code

Returns
string

Definition at line 903 of file Store.php.

904  {
905  // try to get currently set code among allowed
906  $code = $this->_httpContext->getValue(Context::CONTEXT_CURRENCY);
907  $code = $code === null ? $this->_getSession()->getCurrencyCode() : $code;
908  if (empty($code)) {
909  $code = $this->getDefaultCurrencyCode();
910  }
911  if (in_array($code, $this->getAvailableCurrencyCodes(true))) {
912  return $code;
913  }
914 
915  // take first one of allowed codes
916  $codes = array_values($this->getAvailableCurrencyCodes(true));
917  if (empty($codes)) {
918  // return default code, if no codes specified at all
919  return $this->getDefaultCurrencyCode();
920  }
921  return array_shift($codes);
922  }
getAvailableCurrencyCodes($skipBaseNotAllowed=false)
Definition: Store.php:933
$code
Definition: info.phtml:12

◆ getCurrentCurrencyRate()

getCurrentCurrencyRate ( )

Retrieve current currency rate

Returns
float

Definition at line 998 of file Store.php.

999  {
1000  return $this->getBaseCurrency()->getRate($this->getCurrentCurrency());
1001  }

◆ getCurrentUrl()

getCurrentUrl (   $fromStore = true)

Retrieve current url for store

Parameters
bool$fromStore
Returns
string @SuppressWarnings(PHPMD.CyclomaticComplexity) @SuppressWarnings(PHPMD.NPathComplexity)

Definition at line 1171 of file Store.php.

1172  {
1173  $sidQueryParam = $this->_sidResolver->getSessionIdQueryParam($this->_getSession());
1174  $requestString = $this->_url->escape(ltrim($this->_request->getRequestString(), '/'));
1175 
1176  $storeUrl = $this->getUrl('', ['_secure' => $this->_storeManager->getStore()->isCurrentlySecure()]);
1177 
1178  if (!filter_var($storeUrl, FILTER_VALIDATE_URL)) {
1179  return $storeUrl;
1180  }
1181 
1182  $storeParsedUrl = parse_url($storeUrl);
1183 
1184  $storeParsedQuery = [];
1185  if (isset($storeParsedUrl['query'])) {
1186  parse_str($storeParsedUrl['query'], $storeParsedQuery);
1187  }
1188 
1189  $currQuery = $this->_request->getQueryValue();
1190  if (isset($currQuery[$sidQueryParam])
1191  && !empty($currQuery[$sidQueryParam])
1192  && $this->_getSession()->getSessionIdForHost($storeUrl) != $currQuery[$sidQueryParam]
1193  ) {
1194  unset($currQuery[$sidQueryParam]);
1195  }
1196 
1197  foreach ($currQuery as $key => $value) {
1198  $storeParsedQuery[$key] = $value;
1199  }
1200 
1201  if (!$this->isUseStoreInUrl()) {
1202  $storeParsedQuery['___store'] = $this->getCode();
1203  }
1204 
1205  if ($fromStore !== false) {
1206  $storeParsedQuery['___from_store'] = $fromStore ===
1207  true ? $this->_storeManager->getStore()->getCode() : $fromStore;
1208  }
1209 
1210  $requestStringParts = explode('?', $requestString, 2);
1211  $requestStringPath = $requestStringParts[0];
1212  if (isset($requestStringParts[1])) {
1213  parse_str($requestStringParts[1], $requestString);
1214  } else {
1215  $requestString = [];
1216  }
1217 
1218  $currentUrlQueryParams = array_merge($requestString, $storeParsedQuery);
1219 
1220  $currentUrl = $storeParsedUrl['scheme']
1221  . '://'
1222  . $storeParsedUrl['host']
1223  . (isset($storeParsedUrl['port']) ? ':' . $storeParsedUrl['port'] : '')
1224  . $storeParsedUrl['path']
1225  . $requestStringPath
1226  . ($currentUrlQueryParams ? '?' . http_build_query($currentUrlQueryParams) : '');
1227 
1228  return $currentUrl;
1229  }
$value
Definition: gender.phtml:16

◆ getDefaultCurrency()

getDefaultCurrency ( )

Retrieve store default currency

Returns
Currency

Definition at line 870 of file Store.php.

871  {
872  $currency = $this->getData('default_currency');
873  if (null === $currency) {
874  $currency = $this->currencyFactory->create()->load($this->getDefaultCurrencyCode());
875  $this->setData('default_currency', $currency);
876  }
877  return $currency;
878  }

◆ getDefaultCurrencyCode()

getDefaultCurrencyCode ( )

Get default store currency code

Returns
string

Definition at line 859 of file Store.php.

◆ getDefaultGroupId()

getDefaultGroupId ( )

Retrieve default group identifier

Returns
string|int|null

Definition at line 1130 of file Store.php.

1131  {
1132  return $this->_getData('default_group_id');
1133  }

◆ getExtensionAttributes()

getExtensionAttributes ( )

{Retrieve existing extension attributes object or create a new one.

Returns
\Magento\Store\Api\Data\StoreExtensionInterface|null
}

Implements StoreInterface.

Definition at line 1376 of file Store.php.

◆ getFormattedAddress()

getFormattedAddress ( )

Retrieve formatted store address from config

Returns
string

Definition at line 1331 of file Store.php.

1332  {
1333  return $this->information->getFormattedAddress($this);
1334  }

◆ getFrontendName()

getFrontendName ( )

Retrieve store group name

Returns
string

Definition at line 1316 of file Store.php.

1317  {
1318  if (null === $this->_frontendName) {
1319  $storeGroupName = (string)$this->_config
1321  $this->_frontendName = !empty($storeGroupName) ? $storeGroupName : $this->getGroup()->getName();
1322  }
1323  return $this->_frontendName;
1324  }

◆ getGroup()

getGroup ( )

Retrieve group model

Returns
Group|bool

Definition at line 1033 of file Store.php.

1034  {
1035  if (null === $this->getGroupId()) {
1036  return false;
1037  }
1038  return $this->groupRepository->get($this->getGroupId());
1039  }

◆ getGroupId()

getGroupId ( )

Retrieve group identifier

Returns
string|int|null

Definition at line 1086 of file Store.php.

1087  {
1088  return $this->_getData('group_id');
1089  }

◆ getId()

getId ( )

Get store identifier

Returns
int

Implements ScopeInterface.

Definition at line 769 of file Store.php.

770  {
771  return $this->_getData(self::STORE_ID);
772  }

◆ getIdentities()

getIdentities ( )

Get identities

Returns
array

Implements IdentityInterface.

Definition at line 1341 of file Store.php.

1342  {
1343  return [self::CACHE_TAG];
1344  }

◆ getIsActive()

getIsActive ( )

Returns
int

Implements StoreInterface.

Definition at line 1112 of file Store.php.

1113  {
1114  return $this->_getData('is_active');
1115  }

◆ getName()

getName ( )

Get scope name

Returns
string
Since
100.1.0

Implements ScopeInterface.

Definition at line 526 of file Store.php.

527  {
528  return $this->_getData('name');
529  }

◆ getRootCategoryId()

getRootCategoryId ( )

Retrieve root category identifier

Returns
int

Definition at line 1008 of file Store.php.

1009  {
1010  if (!$this->getGroup()) {
1012  }
1013  return $this->getGroup()->getRootCategoryId();
1014  }

◆ getScopeType()

getScopeType ( )

{Get scope type

Returns
string
Since
100.1.0
}

Since
100.1.0

Implements ScopeInterface.

Definition at line 1359 of file Store.php.

1360  {
1362  }

◆ getScopeTypeName()

getScopeTypeName ( )

{Get scope type name

Returns
string
Since
100.1.0
}

Since
100.1.0

Implements ScopeInterface.

Definition at line 1368 of file Store.php.

1369  {
1370  return 'Store View';
1371  }

◆ getStoreGroupId()

getStoreGroupId ( )

Retrieve store group identifier

Returns
string|int|null

Implements StoreInterface.

Definition at line 1096 of file Store.php.

1097  {
1098  return $this->getGroupId();
1099  }

◆ getStorePath()

getStorePath ( )
Returns
string

Definition at line 1349 of file Store.php.

1350  {
1351  $parsedUrl = parse_url($this->getBaseUrl());
1352  return isset($parsedUrl['path']) ? $parsedUrl['path'] : '/';
1353  }
getBaseUrl($type=UrlInterface::URL_TYPE_LINK, $secure=null)
Definition: Store.php:607

◆ getWebsite()

getWebsite ( )

Retrieve store website

Returns
Website|bool

Definition at line 570 of file Store.php.

571  {
572  if ($this->getWebsiteId() === null) {
573  return false;
574  }
575  return $this->websiteRepository->getById($this->getWebsiteId());
576  }

◆ getWebsiteId()

getWebsiteId ( )

Retrieve website identifier

Returns
string|int|null

Implements StoreInterface.

Definition at line 1046 of file Store.php.

1047  {
1048  return $this->_getData('website_id');
1049  }

◆ isActive()

isActive ( )

Check if store is active

Returns
boolean

Definition at line 1236 of file Store.php.

1237  {
1238  return (bool)$this->_getData('is_active');
1239  }

◆ isCanDelete()

isCanDelete ( )

Check if store can be deleted

Returns
boolean

Definition at line 1140 of file Store.php.

1141  {
1142  if (!$this->getId()) {
1143  return false;
1144  }
1145 
1146  return $this->getGroup()->getStoresCount() > 1;
1147  }

◆ isCurrentlySecure()

isCurrentlySecure ( )

Check if request was secure

Returns
boolean

Definition at line 801 of file Store.php.

802  {
803  if ($this->_request->isSecure()) {
804  return true;
805  }
806 
807  $secureBaseUrl = $this->_config->getValue(self::XML_PATH_SECURE_BASE_URL, ScopeInterface::SCOPE_STORE);
808  $secureFrontend = $this->_config->getValue(self::XML_PATH_SECURE_IN_FRONTEND, ScopeInterface::SCOPE_STORE);
809 
810  if (!$secureBaseUrl || !$secureFrontend) {
811  return false;
812  }
813 
814  $uri = UriFactory::factory($secureBaseUrl);
815  $port = $uri->getPort();
816  $serverPort = $this->_request->getServer('SERVER_PORT');
817  $isSecure = $uri->getScheme() == 'https' && isset($serverPort) && $port == $serverPort;
818  return $isSecure;
819  }

◆ isDefault()

isDefault ( )

Check if store is default

Returns
boolean
Since
100.1.0

Definition at line 1155 of file Store.php.

1156  {
1157  if (!$this->getId() && $this->getWebsite() && $this->getWebsite()->getStoresCount() == 0) {
1158  return true;
1159  }
1160  return $this->getGroup()->getDefaultStoreId() == $this->getId();
1161  }

◆ isFrontUrlSecure()

isFrontUrlSecure ( )

Check if frontend URLs should be secure

Returns
boolean

Definition at line 779 of file Store.php.

780  {
781  if ($this->_isFrontSecure === null) {
782  $this->_isFrontSecure = $this->_config
783  ->isSetFlag(self::XML_PATH_SECURE_IN_FRONTEND, ScopeInterface::SCOPE_STORE, $this->getId());
784  }
785  return $this->_isFrontSecure;
786  }

◆ isReadOnly()

isReadOnly (   $value = null)

Get/Set isReadOnly flag

Parameters
bool$value
Returns
bool

Definition at line 1303 of file Store.php.

1304  {
1305  if (null !== $value) {
1306  $this->_isReadOnly = (bool)$value;
1307  }
1308  return $this->_isReadOnly;
1309  }
$value
Definition: gender.phtml:16

◆ isUrlSecure()

isUrlSecure ( )
Returns
bool

Implements ScopeInterface.

Definition at line 791 of file Store.php.

792  {
793  return $this->isFrontUrlSecure();
794  }

◆ isUseStoreInUrl()

isUseStoreInUrl ( )

Returns whether url forming scheme prepends url path with store view code

Returns
boolean

Definition at line 758 of file Store.php.

759  {
760  return !($this->hasDisableStoreInUrl() && $this->getDisableStoreInUrl())
761  && $this->getConfig(self::XML_PATH_STORE_IN_URL);
762  }

◆ load()

load (   $key,
  $field = null 
)

Loading store data

Parameters
mixed$key
string$field
Returns
$this

Definition at line 496 of file Store.php.

497  {
498  if (!is_numeric($key) && $field === null) {
499  $this->_getResource()->load($this, $key, 'code');
500  return $this;
501  }
502  return parent::load($key, $field);
503  }

◆ resetConfig()

resetConfig ( )

Reinit and reset Config Data

Returns
$this

Definition at line 1287 of file Store.php.

1288  {
1289  $this->_config->reinit();
1290  $this->_dirCache = [];
1291  $this->_baseUrlCache = [];
1292  $this->_urlCache = [];
1293 
1294  return $this;
1295  }

◆ setCode()

setCode (   $code)

Parameters
string$code
Returns
$this

Implements StoreInterface.

Definition at line 518 of file Store.php.

519  {
520  return $this->setData('code', $code);
521  }
$code
Definition: info.phtml:12

◆ setCurrentCurrencyCode()

setCurrentCurrencyCode (   $code)

Set current store currency code

Parameters
string$code
Returns
string

Definition at line 886 of file Store.php.

887  {
888  $code = strtoupper($code);
889  if (in_array($code, $this->getAvailableCurrencyCodes())) {
890  $this->_getSession()->setCurrencyCode($code);
891 
892  $defaultCode = $this->_storeManager->getWebsite()->getDefaultStore()->getDefaultCurrency()->getCode();
893  $this->_httpContext->setValue(Context::CONTEXT_CURRENCY, $code, $defaultCode);
894  }
895  return $this;
896  }
getAvailableCurrencyCodes($skipBaseNotAllowed=false)
Definition: Store.php:933
$code
Definition: info.phtml:12

◆ setExtensionAttributes()

setExtensionAttributes ( \Magento\Store\Api\Data\StoreExtensionInterface  $extensionAttributes)
Parameters
\Magento\Store\Api\Data\StoreExtensionInterface$extensionAttributes
Returns
$this

Definition at line 1385 of file Store.php.

1387  {
1389  }
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)

◆ setGroup()

setGroup ( Group  $group)

Set group model for store

Parameters
Group$group
Returns
Store

Definition at line 1022 of file Store.php.

1023  {
1024  $this->setGroupId($group->getId());
1025  return $this;
1026  }
$group
Definition: sections.phtml:16

◆ setIsActive()

setIsActive (   $isActive)

Parameters
int$isActive
Returns
$this

Implements StoreInterface.

Definition at line 1120 of file Store.php.

1121  {
1122  return $this->setData('is_active', $isActive);
1123  }

◆ setName()

setName (   $name)

Set store name

Parameters
string$name
Returns
$this

Implements StoreInterface.

Definition at line 534 of file Store.php.

535  {
536  return $this->setData('name', $name);
537  }
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ setStoreGroupId()

setStoreGroupId (   $storeGroupId)

Parameters
int$storeGroupId
Returns
$this

Implements StoreInterface.

Definition at line 1104 of file Store.php.

1105  {
1106  return $this->setGroupId($storeGroupId);
1107  }

◆ setWebsite()

setWebsite ( Website  $website)

Set relation to the website

Parameters
Website$website
Returns
void

Definition at line 560 of file Store.php.

561  {
562  $this->setWebsiteId($website->getId());
563  }
setWebsiteId($websiteId)
Definition: Store.php:1076

◆ setWebsiteId()

setWebsiteId (   $websiteId)

Parameters
int$websiteId
Returns
$this

Implements StoreInterface.

Definition at line 1076 of file Store.php.

1077  {
1078  return $this->setData('website_id', $websiteId);
1079  }

Field Documentation

◆ $_baseUrlCache

$_baseUrlCache = []
protected

Definition at line 197 of file Store.php.

◆ $_cacheTag

$_cacheTag = true
protected

Definition at line 141 of file Store.php.

◆ $_config

$_config
protected

Definition at line 276 of file Store.php.

◆ $_configCache

$_configCache = null
protected

Definition at line 169 of file Store.php.

◆ $_configCacheBaseNodes

$_configCacheBaseNodes = []
protected

Definition at line 176 of file Store.php.

◆ $_configCacheType

$_configCacheType
protected

Definition at line 134 of file Store.php.

◆ $_configDataResource

$_configDataResource
protected

Definition at line 255 of file Store.php.

◆ $_coreFileStorageDatabase

$_coreFileStorageDatabase = null
protected

Definition at line 262 of file Store.php.

◆ $_currencyInstalled

$_currencyInstalled
protected

Definition at line 286 of file Store.php.

◆ $_dirCache

$_dirCache = []
protected

Definition at line 183 of file Store.php.

◆ $_eventObject

$_eventObject = 'store'
protected

Definition at line 155 of file Store.php.

◆ $_eventPrefix

$_eventPrefix = 'store'
protected

Definition at line 148 of file Store.php.

◆ $_frontendName

$_frontendName = null
protected

Definition at line 226 of file Store.php.

◆ $_httpContext

$_httpContext
protected

Definition at line 291 of file Store.php.

◆ $_isAdminSecure

$_isAdminSecure = null
protected

Definition at line 212 of file Store.php.

◆ $_isCustomEntryPoint

$_isCustomEntryPoint = false
protected

Definition at line 245 of file Store.php.

◆ $_isFrontSecure

$_isFrontSecure = null
protected

Definition at line 219 of file Store.php.

◆ $_priceFilter

$_priceFilter
protected

Definition at line 162 of file Store.php.

◆ $_request

$_request
protected

Definition at line 250 of file Store.php.

◆ $_session

$_session
protected

Definition at line 204 of file Store.php.

◆ $_sidResolver

$_sidResolver
protected

Definition at line 281 of file Store.php.

◆ $_url

$_url
protected

Definition at line 240 of file Store.php.

◆ $_urlCache

$_urlCache = []
protected

Definition at line 190 of file Store.php.

◆ $currencyFactory

$currencyFactory
protected

Definition at line 296 of file Store.php.

◆ $filesystem

$filesystem
protected

Definition at line 269 of file Store.php.

◆ $groupRepository

$groupRepository
protected

Definition at line 301 of file Store.php.

◆ $information

$information
protected

Definition at line 311 of file Store.php.

◆ $websiteRepository

$websiteRepository
protected

Definition at line 306 of file Store.php.

◆ ADMIN_CODE

const ADMIN_CODE = 'admin'

#-

Definition at line 103 of file Store.php.

◆ BASE_URL_PLACEHOLDER

const BASE_URL_PLACEHOLDER = '{{base_url}}'

A placeholder for generating base URL

Definition at line 118 of file Store.php.

◆ CACHE_TAG

const CACHE_TAG = 'store'

Cache tag

Definition at line 108 of file Store.php.

◆ CUSTOM_ENTRY_POINT_PARAM

const CUSTOM_ENTRY_POINT_PARAM = 'custom_entry_point'

Custom entry point param

Definition at line 57 of file Store.php.

◆ DEFAULT_STORE_ID

const DEFAULT_STORE_ID = 0

Identifier of default store used for loading data of default scope

Definition at line 124 of file Store.php.

◆ DISTRO_STORE_ID

const DISTRO_STORE_ID = 1

Default store Id (for install)

Definition at line 129 of file Store.php.

◆ ENTITY

const ENTITY = 'store'

Entity name

Definition at line 52 of file Store.php.

◆ MEDIA_REWRITE_SCRIPT

const MEDIA_REWRITE_SCRIPT = 'get.php/'

Script name, which returns all the images

Definition at line 113 of file Store.php.

◆ PRICE_SCOPE_GLOBAL

const PRICE_SCOPE_GLOBAL = 0

#- #+ Price scope constants

Definition at line 97 of file Store.php.

◆ PRICE_SCOPE_WEBSITE

const PRICE_SCOPE_WEBSITE = 1

Definition at line 99 of file Store.php.

◆ STORE_ID

const STORE_ID = 'store_id'

Store Id key name

Definition at line 47 of file Store.php.

◆ XML_PATH_ENABLE_HSTS

const XML_PATH_ENABLE_HSTS = 'web/secure/enable_hsts'

Definition at line 74 of file Store.php.

◆ XML_PATH_ENABLE_UPGRADE_INSECURE

const XML_PATH_ENABLE_UPGRADE_INSECURE = 'web/secure/enable_upgrade_insecure'

Definition at line 76 of file Store.php.

◆ XML_PATH_PRICE_SCOPE

const XML_PATH_PRICE_SCOPE = 'catalog/price/scope'

Definition at line 90 of file Store.php.

◆ XML_PATH_SECURE_BASE_LINK_URL

const XML_PATH_SECURE_BASE_LINK_URL = 'web/secure/base_link_url'

Definition at line 78 of file Store.php.

◆ XML_PATH_SECURE_BASE_MEDIA_URL

const XML_PATH_SECURE_BASE_MEDIA_URL = 'web/secure/base_media_url'

Definition at line 86 of file Store.php.

◆ XML_PATH_SECURE_BASE_STATIC_URL

const XML_PATH_SECURE_BASE_STATIC_URL = 'web/secure/base_static_url'

Definition at line 82 of file Store.php.

◆ XML_PATH_SECURE_BASE_URL

const XML_PATH_SECURE_BASE_URL = 'web/secure/base_url'

Definition at line 68 of file Store.php.

◆ XML_PATH_SECURE_IN_ADMINHTML

const XML_PATH_SECURE_IN_ADMINHTML = 'web/secure/use_in_adminhtml'

Definition at line 72 of file Store.php.

◆ XML_PATH_SECURE_IN_FRONTEND

const XML_PATH_SECURE_IN_FRONTEND = 'web/secure/use_in_frontend'

Definition at line 70 of file Store.php.

◆ XML_PATH_STORE_IN_URL

const XML_PATH_STORE_IN_URL = 'web/url/use_store'

#+ Configuration paths

Definition at line 62 of file Store.php.

◆ XML_PATH_UNSECURE_BASE_LINK_URL

const XML_PATH_UNSECURE_BASE_LINK_URL = 'web/unsecure/base_link_url'

Definition at line 80 of file Store.php.

◆ XML_PATH_UNSECURE_BASE_MEDIA_URL

const XML_PATH_UNSECURE_BASE_MEDIA_URL = 'web/unsecure/base_media_url'

Definition at line 88 of file Store.php.

◆ XML_PATH_UNSECURE_BASE_STATIC_URL

const XML_PATH_UNSECURE_BASE_STATIC_URL = 'web/unsecure/base_static_url'

Definition at line 84 of file Store.php.

◆ XML_PATH_UNSECURE_BASE_URL

const XML_PATH_UNSECURE_BASE_URL = 'web/unsecure/base_url'

Definition at line 66 of file Store.php.

◆ XML_PATH_USE_REWRITES

const XML_PATH_USE_REWRITES = 'web/seo/use_rewrites'

Definition at line 64 of file Store.php.


The documentation for this class was generated from the following file: