Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
Website Class Reference
Inheritance diagram for Website:
AbstractExtensibleModel IdentityInterface ScopeInterface WebsiteInterface AbstractModel CustomAttributesDataInterface 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\Config\Model\ResourceModel\Config\Data $configDataResource, \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\Store\Model\ResourceModel\Store\CollectionFactory $storeListFactory, \Magento\Store\Model\GroupFactory $storeGroupFactory, \Magento\Store\Model\WebsiteFactory $websiteFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 load ($id, $field=null)
 
 getConfig ($path)
 
 setGroups ($groups)
 
 getGroupCollection ()
 
 getGroups ()
 
 getGroupIds ()
 
 getGroupsCount ()
 
 getDefaultGroup ()
 
 setStores ($stores)
 
 getStoreCollection ()
 
 getStores ()
 
 getStoreIds ()
 
 getStoreCodes ()
 
 getStoresCount ()
 
 isCanDelete ()
 
 getWebsiteGroupStore ()
 
 getDefaultGroupId ()
 
 setDefaultGroupId ($defaultGroupId)
 
 getCode ()
 
 setCode ($code)
 
 getName ()
 
 setName ($name)
 
 beforeDelete ()
 
 afterDelete ()
 
 afterSave ()
 
 getBaseCurrencyCode ()
 
 getBaseCurrency ()
 
 getDefaultStore ()
 
 getDefaultStoresSelect ($withDefault=false)
 
 isReadOnly ($value=null)
 
 getIdentities ()
 
 getScopeType ()
 
 getScopeTypeName ()
 
 getExtensionAttributes ()
 
 setExtensionAttributes (\Magento\Store\Api\Data\WebsiteExtensionInterface $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 ScopeInterface
 getId ()
 
- Public Member Functions inherited from WebsiteInterface
 getId ()
 
 setId ($id)
 
 setExtensionAttributes (\Magento\Store\Api\Data\WebsiteExtensionInterface $extensionAttributes)
 

Data Fields

const ENTITY = 'store_website'
 
const CACHE_TAG = 'website'
 
- 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'
 
- Data Fields inherited from WebsiteInterface
const ADMIN_CODE = 'admin'
 

Protected Member Functions

 _construct ()
 
 _loadGroups ()
 
 _loadStores ()
 
- 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

 $_cacheTag = true
 
 $_eventPrefix = 'website'
 
 $_eventObject = 'website'
 
 $_configCache = []
 
 $_groups
 
 $_groupIds = []
 
 $_groupsCount
 
 $_stores
 
 $_storeIds = []
 
 $_storeCodes = []
 
 $_storesCount = 0
 
 $_defaultGroup
 
 $_defaultStore
 
 $_isCanDelete
 
 $_configDataResource
 
 $storeListFactory
 
 $_storeGroupFactory
 
 $_websiteFactory
 
 $_storeManager
 
 $_currencyFactory
 
- 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

Core Website model

@api @method string getGroupTitle() @method string getStoreTitle() @method int getStoreId() @method int getGroupId() @method int getWebsiteId() @method bool hasWebsiteId() @method int getSortOrder() @method \Magento\Store\Model\Website setSortOrder($value) @method int getIsDefault() @method \Magento\Store\Model\Website setIsDefault($value) @SuppressWarnings(PHPMD.TooManyFields) @SuppressWarnings(PHPMD.CouplingBetweenObjects)

Since
100.0.2

Definition at line 26 of file Website.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\Config\Model\ResourceModel\Config\Data  $configDataResource,
\Magento\Framework\App\Config\ScopeConfigInterface  $coreConfig,
\Magento\Store\Model\ResourceModel\Store\CollectionFactory  $storeListFactory,
\Magento\Store\Model\GroupFactory  $storeGroupFactory,
\Magento\Store\Model\WebsiteFactory  $websiteFactory,
\Magento\Store\Model\StoreManagerInterface  $storeManager,
\Magento\Directory\Model\CurrencyFactory  $currencyFactory,
\Magento\Framework\Model\ResourceModel\AbstractResource  $resource = null,
\Magento\Framework\Data\Collection\AbstractDb  $resourceCollection = null,
array  $data = [] 
)
Parameters
\Magento\Framework\Model\Context$context
\Magento\Framework\Registry$registry
\Magento\Framework\Api\ExtensionAttributesFactory$extensionFactory
\Magento\Framework\Api\AttributeValueFactory$customAttributeFactory
\Magento\Config\Model\ResourceModel\Config\Data$configDataResource
\Magento\Framework\App\Config\ScopeConfigInterface$coreConfig
\Magento\Store\Model\ResourceModel\Store\CollectionFactory$storeListFactory
\Magento\Store\Model\GroupFactory$storeGroupFactory
\Magento\Store\Model\WebsiteFactory$websiteFactory
\Magento\Store\Model\StoreManagerInterface$storeManager
\Magento\Directory\Model\CurrencyFactory$currencyFactory
\Magento\Framework\Model\ResourceModel\AbstractResource$resource
\Magento\Framework\Data\Collection\AbstractDb$resourceCollection
array$data@SuppressWarnings(PHPMD.ExcessiveParameterList)

Definition at line 179 of file Website.php.

194  {
195  parent::__construct(
196  $context,
197  $registry,
198  $extensionFactory,
200  $resource,
201  $resourceCollection,
202  $data
203  );
204  $this->_configDataResource = $configDataResource;
205  $this->_coreConfig = $coreConfig;
206  $this->storeListFactory = $storeListFactory;
207  $this->_storeGroupFactory = $storeGroupFactory;
208  $this->_websiteFactory = $websiteFactory;
209  $this->_storeManager = $storeManager;
210  $this->_currencyFactory = $currencyFactory;
211  }
$storeManager
$resource
Definition: bulk.php:12

Member Function Documentation

◆ _construct()

_construct ( )
protected

init model

Returns
void

Definition at line 218 of file Website.php.

219  {
220  $this->_init(\Magento\Store\Model\ResourceModel\Website::class);
221  }

◆ _loadGroups()

_loadGroups ( )
protected

Load group collection and set internal data

Returns
void

Definition at line 266 of file Website.php.

267  {
268  $this->_groups = [];
269  $this->_groupsCount = 0;
270  foreach ($this->getGroupCollection() as $group) {
271  $this->_groups[$group->getId()] = $group;
272  $this->_groupIds[$group->getId()] = $group->getId();
273  if ($this->getDefaultGroupId() == $group->getId()) {
274  $this->_defaultGroup = $group;
275  }
276  $this->_groupsCount++;
277  }
278  }
$group
Definition: sections.phtml:16

◆ _loadStores()

_loadStores ( )
protected

Load store collection and set internal data

Returns
void

Definition at line 372 of file Website.php.

373  {
374  $this->_stores = [];
375  $this->_storesCount = 0;
376  foreach ($this->getStoreCollection() as $store) {
377  $this->_stores[$store->getId()] = $store;
378  $this->_storeIds[$store->getId()] = $store->getId();
379  $this->_storeCodes[$store->getId()] = $store->getCode();
380  if ($this->getDefaultGroup() && $this->getDefaultGroup()->getDefaultStoreId() == $store->getId()) {
381  $this->_defaultStore = $store;
382  }
383  $this->_storesCount++;
384  }
385  }

◆ afterDelete()

afterDelete ( )

Rewrite in order to clear configuration cache

Returns
$this

Definition at line 566 of file Website.php.

567  {
568  $this->_storeManager->reinitStores();
569  parent::afterDelete();
570  return $this;
571  }

◆ afterSave()

afterSave ( )

Clear configuration cache after creation website

Returns
$this
Since
100.2.0

Definition at line 579 of file Website.php.

580  {
581  if ($this->isObjectNew()) {
582  $this->_storeManager->reinitStores();
583  }
584 
585  return parent::afterSave();
586  }

◆ beforeDelete()

beforeDelete ( )
Returns
$this

Definition at line 548 of file Website.php.

549  {
550  $this->_configDataResource->clearScopeData(
552  $this->getId()
553  );
554  $this->_configDataResource->clearScopeData(
556  $this->getStoreIds()
557  );
558  return parent::beforeDelete();
559  }

◆ getBaseCurrency()

getBaseCurrency ( )

Retrieve website base currency

Returns
\Magento\Directory\Model\Currency

Definition at line 615 of file Website.php.

616  {
617  $currency = $this->getData('base_currency');
618  if ($currency === null) {
619  $currency = $this->_currencyFactory->create()->load($this->getBaseCurrencyCode());
620  $this->setData('base_currency', $currency);
621  }
622  return $currency;
623  }

◆ getBaseCurrencyCode()

getBaseCurrencyCode ( )

Retrieve website base currency code

Returns
string

Definition at line 593 of file Website.php.

594  {
595  if ($this->getConfig(
597  ) == \Magento\Store\Model\Store::PRICE_SCOPE_GLOBAL
598  ) {
599  $currencyCode = $this->_coreConfig->getValue(
600  \Magento\Directory\Model\Currency::XML_PATH_CURRENCY_BASE,
601  'default'
602  );
603  } else {
604  $currencyCode = $this->getConfig(\Magento\Directory\Model\Currency::XML_PATH_CURRENCY_BASE);
605  }
606 
607  return $currencyCode;
608  }

◆ getCode()

getCode ( )
Returns
mixed

Implements ScopeInterface.

Definition at line 516 of file Website.php.

517  {
518  return $this->_getData('code');
519  }

◆ getConfig()

getConfig (   $path)

Get website config data

Parameters
string$path
Returns
mixed

Definition at line 245 of file Website.php.

246  {
247  if (!isset($this->_configCache[$path])) {
248  $config = $this->_coreConfig->getValue(
249  $path,
251  $this->getCode()
252  );
253  if (!$config) {
254  return false;
255  }
256  $this->_configCache[$path] = $config;
257  }
258  return $this->_configCache[$path];
259  }
$config
Definition: fraud_order.php:17

◆ getDefaultGroup()

getDefaultGroup ( )

Retrieve default group model

Returns
\Magento\Store\Model\Store

Definition at line 356 of file Website.php.

357  {
358  if (!$this->hasDefaultGroupId()) {
359  return false;
360  }
361  if ($this->_groups === null) {
362  $this->_loadGroups();
363  }
364  return $this->_defaultGroup;
365  }

◆ getDefaultGroupId()

getDefaultGroupId ( )
Returns
mixed

Implements WebsiteInterface.

Definition at line 500 of file Website.php.

501  {
502  return $this->_getData('default_group_id');
503  }

◆ getDefaultStore()

getDefaultStore ( )

Retrieve Default Website Store or null

Returns
Store

Definition at line 630 of file Website.php.

631  {
632  // init stores if not loaded
633  $this->getStores();
634  return $this->_defaultStore;
635  }

◆ getDefaultStoresSelect()

getDefaultStoresSelect (   $withDefault = false)

Retrieve default stores select object Select fields website_id, store_id

Parameters
bool$withDefaultinclude/exclude default admin website
Returns
\Magento\Framework\DB\Select

Definition at line 644 of file Website.php.

645  {
646  return $this->getResource()->getDefaultStoresSelect($withDefault);
647  }

◆ getExtensionAttributes()

getExtensionAttributes ( )

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

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

Implements WebsiteInterface.

Definition at line 694 of file Website.php.

◆ getGroupCollection()

getGroupCollection ( )

Retrieve new (not loaded) Group collection object with website filter

Returns
\Magento\Store\Model\ResourceModel\Group\Collection

Definition at line 306 of file Website.php.

307  {
308  return $this->_storeGroupFactory->create()->getCollection()->addWebsiteFilter($this->getId())
309  ->setLoadDefault(true);
310  }

◆ getGroupIds()

getGroupIds ( )

Retrieve website group ids

Returns
array

Definition at line 330 of file Website.php.

331  {
332  if ($this->_groups === null) {
333  $this->_loadGroups();
334  }
335  return $this->_groupIds;
336  }

◆ getGroups()

getGroups ( )

Retrieve website groups

Returns
\Magento\Store\Model\Store[]

Definition at line 317 of file Website.php.

318  {
319  if ($this->_groups === null) {
320  $this->_loadGroups();
321  }
322  return $this->_groups;
323  }

◆ getGroupsCount()

getGroupsCount ( )

Retrieve number groups in a website

Returns
int

Definition at line 343 of file Website.php.

344  {
345  if ($this->_groups === null) {
346  $this->_loadGroups();
347  }
348  return $this->_groupsCount;
349  }

◆ getIdentities()

getIdentities ( )

Get identities

Returns
array

Implements IdentityInterface.

Definition at line 668 of file Website.php.

669  {
670  return [self::CACHE_TAG];
671  }

◆ getName()

getName ( )

Get scope name

Returns
string
Since
100.1.0

Implements ScopeInterface.

Definition at line 532 of file Website.php.

533  {
534  return $this->_getData('name');
535  }

◆ getScopeType()

getScopeType ( )

{Get scope type

Returns
string
Since
100.1.0
}

Since
100.1.0

Implements ScopeInterface.

Definition at line 677 of file Website.php.

678  {
679  return \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE;
680  }

◆ getScopeTypeName()

getScopeTypeName ( )

{Get scope type name

Returns
string
Since
100.1.0
}

Since
100.1.0

Implements ScopeInterface.

Definition at line 686 of file Website.php.

687  {
688  return 'Website';
689  }

◆ getStoreCodes()

getStoreCodes ( )

Retrieve website store codes

Returns
array

Definition at line 449 of file Website.php.

450  {
451  if ($this->_stores === null) {
452  $this->_loadStores();
453  }
454  return $this->_storeCodes;
455  }

◆ getStoreCollection()

getStoreCollection ( )

Retrieve new (not loaded) Store collection object with website filter

Returns
\Magento\Store\Model\ResourceModel\Store\Collection

Definition at line 413 of file Website.php.

414  {
415  return $this->storeListFactory->create()->addWebsiteFilter($this->getId())->setLoadDefault(true);
416  }

◆ getStoreIds()

getStoreIds ( )

Retrieve website store ids

Returns
array

Definition at line 436 of file Website.php.

437  {
438  if ($this->_stores === null) {
439  $this->_loadStores();
440  }
441  return $this->_storeIds;
442  }

◆ getStores()

getStores ( )

Retrieve website store objects

Returns
array

Definition at line 423 of file Website.php.

424  {
425  if ($this->_stores === null) {
426  $this->_loadStores();
427  }
428  return $this->_stores;
429  }

◆ getStoresCount()

getStoresCount ( )

Retrieve number stores in a website

Returns
int

Definition at line 462 of file Website.php.

463  {
464  if ($this->_stores === null) {
465  $this->_loadStores();
466  }
467  return $this->_storesCount;
468  }

◆ getWebsiteGroupStore()

getWebsiteGroupStore ( )

Retrieve unique website-group-store key for collection with groups and stores

Returns
string

Definition at line 492 of file Website.php.

493  {
494  return implode('-', [$this->getWebsiteId(), $this->getGroupId(), $this->getStoreId()]);
495  }

◆ isCanDelete()

isCanDelete ( )

Can delete website

Returns
bool

Definition at line 475 of file Website.php.

476  {
477  if ($this->_isReadOnly || !$this->getId()) {
478  return false;
479  }
480  if ($this->_isCanDelete === null) {
481  $this->_isCanDelete = $this->_websiteFactory->create()->getCollection()->getSize() > 1 &&
482  !$this->getIsDefault();
483  }
484  return $this->_isCanDelete;
485  }

◆ isReadOnly()

isReadOnly (   $value = null)

Get/Set isReadOnly flag

Parameters
bool$value
Returns
bool

Definition at line 655 of file Website.php.

656  {
657  if (null !== $value) {
658  $this->_isReadOnly = (bool)$value;
659  }
660  return $this->_isReadOnly;
661  }
$value
Definition: gender.phtml:16

◆ load()

load (   $id,
  $field = null 
)

Custom load

Parameters
int | string$id
string$field
Returns
$this

Definition at line 230 of file Website.php.

231  {
232  if (!is_numeric($id) && $field === null) {
233  $this->_getResource()->load($this, $id, 'code');
234  return $this;
235  }
236  return parent::load($id, $field);
237  }
$id
Definition: fieldset.phtml:14

◆ setCode()

setCode (   $code)

Parameters
string$code
Returns
$this

Implements WebsiteInterface.

Definition at line 524 of file Website.php.

525  {
526  return $this->setData('code', $code);
527  }
$code
Definition: info.phtml:12

◆ setDefaultGroupId()

setDefaultGroupId (   $defaultGroupId)

Parameters
int$defaultGroupId
Returns
$this

Implements WebsiteInterface.

Definition at line 508 of file Website.php.

509  {
510  return $this->setData('default_group_id', $defaultGroupId);
511  }

◆ setExtensionAttributes()

setExtensionAttributes ( \Magento\Store\Api\Data\WebsiteExtensionInterface  $extensionAttributes)

{}

Definition at line 702 of file Website.php.

704  {
706  }
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)

◆ setGroups()

setGroups (   $groups)

Set website groups

Parameters
array$groups
Returns
$this

Definition at line 286 of file Website.php.

287  {
288  $this->_groups = [];
289  $this->_groupsCount = 0;
290  foreach ($groups as $group) {
291  $this->_groups[$group->getId()] = $group;
292  $this->_groupIds[$group->getId()] = $group->getId();
293  if ($this->getDefaultGroupId() == $group->getId()) {
294  $this->_defaultGroup = $group;
295  }
296  $this->_groupsCount++;
297  }
298  return $this;
299  }
$group
Definition: sections.phtml:16

◆ setName()

setName (   $name)

Set website name

Parameters
string$name
Returns
$this

Implements WebsiteInterface.

Definition at line 540 of file Website.php.

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

◆ setStores()

setStores (   $stores)

Set website stores

Parameters
array$stores
Returns
void

Definition at line 393 of file Website.php.

394  {
395  $this->_stores = [];
396  $this->_storesCount = 0;
397  foreach ($stores as $store) {
398  $this->_stores[$store->getId()] = $store;
399  $this->_storeIds[$store->getId()] = $store->getId();
400  $this->_storeCodes[$store->getId()] = $store->getCode();
401  if ($this->getDefaultGroup() && $this->getDefaultGroup()->getDefaultStoreId() == $store->getId()) {
402  $this->_defaultStore = $store;
403  }
404  $this->_storesCount++;
405  }
406  }

Field Documentation

◆ $_cacheTag

$_cacheTag = true
protected

Definition at line 38 of file Website.php.

◆ $_configCache

$_configCache = []
protected

Definition at line 55 of file Website.php.

◆ $_configDataResource

$_configDataResource
protected

Definition at line 135 of file Website.php.

◆ $_currencyFactory

$_currencyFactory
protected

Definition at line 160 of file Website.php.

◆ $_defaultGroup

$_defaultGroup
protected

Definition at line 111 of file Website.php.

◆ $_defaultStore

$_defaultStore
protected

Definition at line 118 of file Website.php.

◆ $_eventObject

$_eventObject = 'website'
protected

Definition at line 48 of file Website.php.

◆ $_eventPrefix

$_eventPrefix = 'website'
protected

Definition at line 43 of file Website.php.

◆ $_groupIds

$_groupIds = []
protected

Definition at line 69 of file Website.php.

◆ $_groups

$_groups
protected

Definition at line 62 of file Website.php.

◆ $_groupsCount

$_groupsCount
protected

Definition at line 76 of file Website.php.

◆ $_isCanDelete

$_isCanDelete
protected

Definition at line 125 of file Website.php.

◆ $_storeCodes

$_storeCodes = []
protected

Definition at line 97 of file Website.php.

◆ $_storeGroupFactory

$_storeGroupFactory
protected

Definition at line 145 of file Website.php.

◆ $_storeIds

$_storeIds = []
protected

Definition at line 90 of file Website.php.

◆ $_storeManager

$_storeManager
protected

Definition at line 155 of file Website.php.

◆ $_stores

$_stores
protected

Definition at line 83 of file Website.php.

◆ $_storesCount

$_storesCount = 0
protected

Definition at line 104 of file Website.php.

◆ $_websiteFactory

$_websiteFactory
protected

Definition at line 150 of file Website.php.

◆ $storeListFactory

$storeListFactory
protected

Definition at line 140 of file Website.php.

◆ CACHE_TAG

const CACHE_TAG = 'website'

Definition at line 33 of file Website.php.

◆ ENTITY

const ENTITY = 'store_website'

Definition at line 31 of file Website.php.


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