Mage_Core_Model_Store
extends Mage_Core_Model_Abstract
in package
Table of Contents
Constants
- ADMIN_CODE : mixed = 'admin'
- CACHE_TAG : mixed = 'store'
- Cache tag
- COOKIE_CURRENCY : mixed = 'currency'
- Cookie currency key
- COOKIE_NAME : mixed = 'store'
- Cookie name
- DEFAULT_CODE : mixed = 'default'
- Code constants
- ENTITY : mixed = 'core_store'
- Entity name
- MEDIA_REWRITE_SCRIPT : mixed = 'get.php/'
- Script name, which returns all the images
- PRICE_SCOPE_GLOBAL : mixed = 0
- Price scope constants
- PRICE_SCOPE_WEBSITE : mixed = 1
- URL_TYPE_DIRECT_LINK : mixed = 'direct_link'
- URL_TYPE_JS : mixed = 'js'
- URL_TYPE_LINK : mixed = 'link'
- Possible URL types
- URL_TYPE_MEDIA : mixed = 'media'
- URL_TYPE_SKIN : mixed = 'skin'
- URL_TYPE_WEB : mixed = 'web'
- XML_PATH_OFFLOADER_HEADER : mixed = 'web/secure/offloader_header'
- XML_PATH_PRICE_SCOPE : mixed = 'catalog/price/scope'
- XML_PATH_SECURE_BASE_JS_URL : mixed = 'web/secure/base_js_url'
- XML_PATH_SECURE_BASE_LINK_URL : mixed = 'web/secure/base_link_url'
- XML_PATH_SECURE_BASE_MEDIA_URL : mixed = 'web/secure/base_media_url'
- XML_PATH_SECURE_BASE_SKIN_URL : mixed = 'web/secure/base_skin_url'
- XML_PATH_SECURE_BASE_URL : mixed = 'web/secure/base_url'
- XML_PATH_SECURE_IN_ADMINHTML : mixed = 'web/secure/use_in_adminhtml'
- XML_PATH_SECURE_IN_FRONTEND : mixed = 'web/secure/use_in_frontend'
- XML_PATH_STORE_IN_URL : mixed = 'web/url/use_store'
- XML_PATH_STORE_STORE_HOURS : mixed = 'general/store_information/hours'
- XML_PATH_STORE_STORE_NAME : string = 'general/store_information/name'
- Configuration paths
- XML_PATH_STORE_STORE_PHONE : mixed = 'general/store_information/phone'
- XML_PATH_UNSECURE_BASE_JS_URL : mixed = 'web/unsecure/base_js_url'
- XML_PATH_UNSECURE_BASE_LINK_URL : mixed = 'web/unsecure/base_link_url'
- XML_PATH_UNSECURE_BASE_MEDIA_URL : mixed = 'web/unsecure/base_media_url'
- XML_PATH_UNSECURE_BASE_SKIN_URL : mixed = 'web/unsecure/base_skin_url'
- XML_PATH_UNSECURE_BASE_URL : mixed = 'web/unsecure/base_url'
Properties
- $_baseUrlCache : array<string|int, mixed>
- Base URL cache
- $_cacheTag : string|bool|array<string|int, mixed>
- Cache flag
- $_configCache : array<string|int, mixed>|null
- Store configuration cache
- $_configCacheBaseNodes : array<string|int, mixed>
- Base nodes of store configuration cache
- $_data : array<string|int, mixed>|null
- Object attributes
- $_dataSaveAllowed : bool
- Flag which can stop data saving after before save Can be used for next sequence: we check data in _beforeSave, if data are not valid - we can set this flag to false value and save process will be stopped
- $_dirCache : array<string|int, mixed>
- Directory cache
- $_dirty : array<string|int, mixed>
- $_eventObject : string
- Parameter name in event
- $_eventPrefix : string
- Event prefix for model events
- $_frontendName : string|null
- Store frontend name
- $_group : Mage_Core_Model_Store_Group|null
- Group model
- $_hasDataChanges : bool
- Data changes flag (true after setData|unsetData call)
- $_idFieldName : string
- Name of object id field
- $_isAdminSecure : bool|null
- Flag that shows that backend URLs are secure
- $_isDeleted : bool
- Object delete flag
- $_isFrontSecure : bool|null
- Flag that shows that frontend URLs are secure
- $_isObjectNew : bool|null
- Flag which allow detect object state: is it new object (without id) or existing one (with id)
- $_oldFieldsMap : array<string|int, mixed>
- Map short fields names to its full names
- $_origData : array<string|int, mixed>|null
- Original data that was loaded
- $_priceFilter : Mage_Directory_Model_Currency_Filter|Sprintf|null
- Price filter
- $_resource : Mage_Core_Model_Resource_Db_Abstract
- Resource model instance
- $_resourceCollectionName : string
- Name of the resource collection model
- $_resourceName : string
- Name of the resource model
- $_session : Mage_Core_Model_Session_Abstract
- Session entity
- $_syncFieldsMap : mixed
- Map of fields to sync to other fields upon changing their data
- $_underscoreCache : array<string|int, mixed>
- Setter/Getter underscore transformation cache
- $_urlCache : array<string|int, mixed>
- URL cache
- $_website : Mage_Core_Model_Website|null
- Website model
- $_isReadOnly : bool
- Readonly flag
Methods
- __call() : mixed
- Set/Get attribute wrapper
- __construct() : mixed
- Constructor
- __get() : mixed
- Attribute getter (deprecated)
- __set() : mixed
- Attribute setter (deprecated)
- __toArray() : array<string|int, mixed>
- Convert object attributes to array
- _getResource() : Mage_Core_Model_Resource_Store
- Get resource instance
- addData() : $this
- Add data to the object.
- afterCommitCallback() : $this
- Callback function which called after transaction commit in resource model
- afterLoad() : $this
- Object after load processing. Implemented as public interface for supporting objects after load in collections
- cleanModelCache() : $this
- Remove model object related cache
- clearCurrencyRateMemos() : static
- Drop the memos answered from the rate table, after the table changed.
- clearCurrentCurrency() : static
- Drop every memo derived from the display currency, or the next switch lands one request late. The session choice survives, and a store object outliving the request in a worker runtime is undone here.
- clearInstance() : $this
- Clearing object for correct deleting by garbage collector
- convertPrice() : float
- Convert price from default currency to current currency
- dataHasChangedFor() : bool
- Compare object data with original data
- debug() : string|array<string|int, mixed>
- Present object data as string in debug mode
- delete() : $this
- Delete object from database
- flagDirty() : $this
- formatPrice() : string|float
- Format price with currency filter (taking rate into consideration)
- getAvailableCurrencyCodes() : array<string|int, mixed>
- Get allowed store currency codes
- getBaseCurrency() : Mage_Directory_Model_Currency
- Retrieve store base currency
- getBaseCurrencyCode() : string
- Retrieve store base currency code
- getBaseUrl() : string
- Retrieve base URL
- getBillingAddress() : Mage_Customer_Model_Address_Abstract|null
- getCacheIdTags() : array<string|int, mixed>|false
- Get cache tags associated with object id
- getCacheTags() : array<string|int, mixed>|false
- Get list of cache tags applied to model object.
- getCode() : string
- Retrieve Store code
- getCollection() : Mage_Core_Model_Resource_Store_Collection
- getConfig() : string|null
- Retrieve store configuration data
- getConfigCache() : array<string|int, mixed>
- Get the basic configuration nodes for this store view
- getCreatedAt() : string|null
- getCurrentCurrency() : Mage_Directory_Model_Currency
- Retrieve store current currency
- getCurrentCurrencyCode() : string
- Get current store currency code
- getCurrentCurrencyRate() : float
- The rate the displayed currency was chosen with.
- getCurrentUrl() : string
- Retrieve current url for store
- getData() : mixed
- Object data getter
- getDataByKey() : mixed
- Get object data by particular key
- getDataByPath() : mixed
- Get object data by path
- getDataSetDefault() : mixed
- Fast get data or set default if value is not available
- getDataUsingMethod() : mixed
- Get object data by key with calling getter method
- getDefaultBasePath() : string
- Retrieve default base path
- getDefaultCurrency() : Mage_Directory_Model_Currency
- Retrieve store default currency
- getDefaultCurrencyCode() : string
- Get default store currency code
- getDefaultGroupId() : int|string|null
- Retrieve default group identifier
- getEntityId() : int
- getFrontendName() : string
- Retrieve storegroup name
- getGroup() : Mage_Core_Model_Store_Group|false
- Retrieve group model
- getGroupId() : int
- Retrieve group identifier
- getHomeUrl() : string|null
- getId() : int|null
- Get store identifier
- getIdFieldName() : string
- Retrieve identifier field name for model
- getIsActive() : bool|null
- Check if store is active
- getLanguageCode() : string|null
- getLocaleCode() : string|null
- getName() : string|null
- Retrieve store name
- getOrigData() : mixed
- Get object loaded data (original data)
- getPriceFilter() : Mage_Directory_Model_Currency_Filter|Sprintf
- Get store price filter
- getRequestedCurrencyCode() : string
- The display currency asked for by session or configuration, before the no-rate fallback in getCurrentCurrency() has a say.
- getResource() : Mage_Core_Model_Resource_Store
- Retrieve model resource
- getResourceCollection() : Mage_Core_Model_Resource_Store_Collection
- Get collection instance
- getResourceName() : string
- Retrieve model resource name
- getRootCategoryId() : int
- Retrieve root category identifier
- getRootCategoryPath() : string|null
- getServeableCurrencyRates() : array<string, float>
- The allowed currencies this store can actually serve, mapped to their rate against base. An allowed currency with no usable rate is not one of them: getCurrentCurrency() falls back to base for it, and where base is not serveable either the store cannot sell at all. Base needs no rate row of its own, but it does have to be allowed.
- getShippingAddress() : Mage_Customer_Model_Address_Abstract|null
- getSortOrder() : int|null
- getStoreId() : int|null
- getStoreInUrl() : bool
- Returns whether url forming scheme prepends url path with store view code.
- getUrl() : string
- Retrieve url using store configuration specific
- getWebsite() : Mage_Core_Model_Website|false
- Retrieve store website
- getWebsiteId() : int
- Retrieve website identifier
- hasData() : bool
- If $key is empty, checks whether there's any data in the object Otherwise checks if the specified attribute is set.
- hasDataChanges() : bool
- Get data change status
- hasErrors() : bool
- isAdmin() : bool
- Check if store is admin store
- isAdminUrlSecure() : bool
- Check if backend URLs should be secure
- isCanDelete() : bool
- Check if store can be deleted
- isDeleted() : bool
- Set _isDeleted flag value (if $isDeleted param is defined) and return current flag value
- isDirty() : bool
- isEmpty() : bool
- checks whether the object is empty
- isFrontUrlSecure() : bool
- Check if frontend URLs should be secure
- isModuleEnabled() : bool
- isObjectNew() : bool
- Check object state (true - if it is object without id on object just created) This method can help detect if object just created in _afterSave method problem is what in after save object has id and we can't detect what object was created in this transaction
- isReadOnly() : bool
- Get/Set isReadOnly flag
- jsonSerialize() : array<string|int, mixed>
- Implementation of JsonSerializable::jsonSerialize()
- load() : $this
- Load object data
- loadConfig() : $this
- Loading store configuration data
- offsetExists() : bool
- Implementation of ArrayAccess::offsetExists()
- offsetGet() : mixed
- Implementation of ArrayAccess::offsetGet()
- offsetSet() : void
- Implementation of ArrayAccess::offsetSet()
- offsetUnset() : void
- Implementation of ArrayAccess::offsetUnset()
- resetConfig() : $this
- Reinit and reset Config Data
- roundPrice() : float
- Round price
- save() : $this
- Save object data
- serialize() : string
- serialize object attributes
- setAttribute() : $this
- setCode() : static
- setConfig() : $this
- Set config value for CURRENT model
- setConfigCache() : $this
- Sets the internal configuration cache for this store view
- setCreatedAt() : static
- setCurrentCurrencyCode() : $this
- Set current store currency code
- setData() : $this
- Overwrite data in the object.
- setDataChanges() : $this
- Clears data changes status
- setDataUsingMethod() : $this
- Set object data with calling setter method
- setGroup() : mixed
- Set group model for store
- setGroupId() : static
- setHomeUrl() : static
- setId() : $this
- Declare model object identifier value
- setIdFieldName() : $this
- set name of object id field
- setIsActive() : static
- setLocaleCode() : static
- setName() : static
- setOrigData() : $this
- Initialize object original data
- setRequestedCurrencyCode() : static
- Apply a display currency for this request alone: in-memory only, the session is never written, so a choice recorded there survives.
- setRootCategory() : static
- setRootCategoryPath() : static
- setSortOrder() : static
- setStoreId() : static
- setUpdatedAt() : static
- setWebsite() : mixed
- Set website model
- setWebsiteId() : static
- toArray() : array<string|int, mixed>
- Public wrapper for __toArray
- toJson() : string
- Public wrapper for __toJson
- toString() : string
- Public wrapper for __toString
- toXml() : string
- Public wrapper for __toXml
- unsetData() : $this
- Unset data from the object.
- unsetOldData() : $this
- Unset old fields data from the object.
- __toJson() : string
- Convert object attributes to JSON
- __toXml() : string
- Convert object attributes to XML
- _addFullNames() : mixed
- _afterDelete() : $this
- rewrite in order to clear configuration cache
- _afterDeleteCommit() : $this
- Init indexing process after store delete commit
- _afterLoad() : $this
- Processing object after load data
- _afterSave() : $this
- Processing object after save data
- _beforeDelete() : $this
- Protect delete from non admin area Register indexing event before delete store
- _beforeLoad() : $this
- Processing object before load data
- _beforeSave() : $this
- Processing object before save data
- _camelize() : string
- _clearData() : $this
- Clearing object's data
- _clearReferences() : $this
- Clearing cyclic references
- _construct() : void
- Initialize object
- _getData() : mixed
- Get value from _data array without parse key
- _getEventData() : array<string|int, mixed>
- Get array of objects transferred to default events processing
- _getSession() : Mage_Core_Model_Session
- Retrieve store session object
- _hasModelChanged() : bool
- Check whether model has changed data.
- _init() : mixed
- Standard model initialization
- _initOldFieldsMap() : mixed
- Inits mapping array of object's previously used fields to new fields.
- _normalizeCurrencyCode() : string
- Configured codes are brought to the one spelling every rate answer is keyed on.
- _prepareArray() : array<string|int, mixed>
- Set required array elements
- _prepareSyncFieldsMap() : $this
- Called after old fields are inited. Forms synchronization map to sync old fields and new fields between each other.
- _processConfigValue() : array<string|int, mixed>|string
- Process config value
- _protectFromNonAdmin() : mixed
- Safeguard func that will check, if we are in admin area
- _setResourceModel() : mixed
- Set resource names
- _underscore() : string
- Converts field names for setters and getters
- _updatePathUseStoreView() : string
- Add store code to url in case if it is enabled in configuration
Constants
ADMIN_CODE
public
mixed
ADMIN_CODE
= 'admin'
CACHE_TAG
Cache tag
public
mixed
CACHE_TAG
= 'store'
COOKIE_CURRENCY
Cookie currency key
public
mixed
COOKIE_CURRENCY
= 'currency'
COOKIE_NAME
Cookie name
public
mixed
COOKIE_NAME
= 'store'
DEFAULT_CODE
Code constants
public
mixed
DEFAULT_CODE
= 'default'
ENTITY
Entity name
public
mixed
ENTITY
= 'core_store'
MEDIA_REWRITE_SCRIPT
Script name, which returns all the images
public
mixed
MEDIA_REWRITE_SCRIPT
= 'get.php/'
PRICE_SCOPE_GLOBAL
Price scope constants
public
mixed
PRICE_SCOPE_GLOBAL
= 0
PRICE_SCOPE_WEBSITE
public
mixed
PRICE_SCOPE_WEBSITE
= 1
URL_TYPE_DIRECT_LINK
public
mixed
URL_TYPE_DIRECT_LINK
= 'direct_link'
URL_TYPE_JS
public
mixed
URL_TYPE_JS
= 'js'
URL_TYPE_LINK
Possible URL types
public
mixed
URL_TYPE_LINK
= 'link'
URL_TYPE_MEDIA
public
mixed
URL_TYPE_MEDIA
= 'media'
URL_TYPE_SKIN
public
mixed
URL_TYPE_SKIN
= 'skin'
URL_TYPE_WEB
public
mixed
URL_TYPE_WEB
= 'web'
XML_PATH_OFFLOADER_HEADER
public
mixed
XML_PATH_OFFLOADER_HEADER
= 'web/secure/offloader_header'
XML_PATH_PRICE_SCOPE
public
mixed
XML_PATH_PRICE_SCOPE
= 'catalog/price/scope'
XML_PATH_SECURE_BASE_JS_URL
public
mixed
XML_PATH_SECURE_BASE_JS_URL
= 'web/secure/base_js_url'
XML_PATH_SECURE_BASE_LINK_URL
public
mixed
XML_PATH_SECURE_BASE_LINK_URL
= 'web/secure/base_link_url'
XML_PATH_SECURE_BASE_MEDIA_URL
public
mixed
XML_PATH_SECURE_BASE_MEDIA_URL
= 'web/secure/base_media_url'
XML_PATH_SECURE_BASE_SKIN_URL
public
mixed
XML_PATH_SECURE_BASE_SKIN_URL
= 'web/secure/base_skin_url'
XML_PATH_SECURE_BASE_URL
public
mixed
XML_PATH_SECURE_BASE_URL
= 'web/secure/base_url'
XML_PATH_SECURE_IN_ADMINHTML
public
mixed
XML_PATH_SECURE_IN_ADMINHTML
= 'web/secure/use_in_adminhtml'
XML_PATH_SECURE_IN_FRONTEND
public
mixed
XML_PATH_SECURE_IN_FRONTEND
= 'web/secure/use_in_frontend'
XML_PATH_STORE_IN_URL
public
mixed
XML_PATH_STORE_IN_URL
= 'web/url/use_store'
XML_PATH_STORE_STORE_HOURS
public
mixed
XML_PATH_STORE_STORE_HOURS
= 'general/store_information/hours'
XML_PATH_STORE_STORE_NAME
Configuration paths
public
string
XML_PATH_STORE_STORE_NAME
= 'general/store_information/name'
XML_PATH_STORE_STORE_PHONE
public
mixed
XML_PATH_STORE_STORE_PHONE
= 'general/store_information/phone'
XML_PATH_UNSECURE_BASE_JS_URL
public
mixed
XML_PATH_UNSECURE_BASE_JS_URL
= 'web/unsecure/base_js_url'
XML_PATH_UNSECURE_BASE_LINK_URL
public
mixed
XML_PATH_UNSECURE_BASE_LINK_URL
= 'web/unsecure/base_link_url'
XML_PATH_UNSECURE_BASE_MEDIA_URL
public
mixed
XML_PATH_UNSECURE_BASE_MEDIA_URL
= 'web/unsecure/base_media_url'
XML_PATH_UNSECURE_BASE_SKIN_URL
public
mixed
XML_PATH_UNSECURE_BASE_SKIN_URL
= 'web/unsecure/base_skin_url'
XML_PATH_UNSECURE_BASE_URL
public
mixed
XML_PATH_UNSECURE_BASE_URL
= 'web/unsecure/base_url'
Properties
$_baseUrlCache
Base URL cache
protected
array<string|int, mixed>
$_baseUrlCache
= []
$_cacheTag
Cache flag
protected
string|bool|array<string|int, mixed>
$_cacheTag
= \true
Attributes
- #[Override]
$_configCache
Store configuration cache
protected
array<string|int, mixed>|null
$_configCache
= \null
$_configCacheBaseNodes
Base nodes of store configuration cache
protected
array<string|int, mixed>
$_configCacheBaseNodes
= []
$_data
Object attributes
protected
array<string|int, mixed>|null
$_data
= []
$_dataSaveAllowed
Flag which can stop data saving after before save Can be used for next sequence: we check data in _beforeSave, if data are not valid - we can set this flag to false value and save process will be stopped
protected
bool
$_dataSaveAllowed
= \true
$_dirCache
Directory cache
protected
array<string|int, mixed>
$_dirCache
= []
$_dirty
protected
array<string|int, mixed>
$_dirty
$_eventObject
Parameter name in event
protected
string
$_eventObject
= 'store'
Attributes
- #[Override]
$_eventPrefix
Event prefix for model events
protected
string
$_eventPrefix
= 'store'
Attributes
- #[Override]
$_frontendName
Store frontend name
protected
string|null
$_frontendName
= \null
$_group
Group model
protected
Mage_Core_Model_Store_Group|null
$_group
$_hasDataChanges
Data changes flag (true after setData|unsetData call)
protected
bool
$_hasDataChanges
= false
$_idFieldName
Name of object id field
protected
string
$_idFieldName
= null
$_isAdminSecure
Flag that shows that backend URLs are secure
protected
bool|null
$_isAdminSecure
= \null
$_isDeleted
Object delete flag
protected
bool
$_isDeleted
= false
$_isFrontSecure
Flag that shows that frontend URLs are secure
protected
bool|null
$_isFrontSecure
= \null
$_isObjectNew
Flag which allow detect object state: is it new object (without id) or existing one (with id)
protected
bool|null
$_isObjectNew
= \null
$_oldFieldsMap
Map short fields names to its full names
protected
array<string|int, mixed>
$_oldFieldsMap
= []
$_origData
Original data that was loaded
protected
array<string|int, mixed>|null
$_origData
$_priceFilter
Price filter
protected
Mage_Directory_Model_Currency_Filter|Sprintf|null
$_priceFilter
$_resource
Resource model instance
protected
Mage_Core_Model_Resource_Db_Abstract
$_resource
$_resourceCollectionName
Name of the resource collection model
protected
string
$_resourceCollectionName
$_resourceName
Name of the resource model
protected
string
$_resourceName
$_session
Session entity
protected
Mage_Core_Model_Session_Abstract
$_session
$_syncFieldsMap
Map of fields to sync to other fields upon changing their data
protected
mixed
$_syncFieldsMap
= []
$_underscoreCache
Setter/Getter underscore transformation cache
protected
static array<string|int, mixed>
$_underscoreCache
= []
$_urlCache
URL cache
protected
array<string|int, mixed>
$_urlCache
= []
$_website
Website model
protected
Mage_Core_Model_Website|null
$_website
$_isReadOnly
Readonly flag
private
bool
$_isReadOnly
= \false
Methods
__call()
Set/Get attribute wrapper
public
__call(string $method, array<string|int, mixed> $args) : mixed
Parameters
- $method : string
- $args : array<string|int, mixed>
__construct()
Constructor
public
__construct() : mixed
By default, is looking for first argument as array and assigns it as object attributes This behaviour may change in child classes
__get()
Attribute getter (deprecated)
public
__get(string $var) : mixed
Parameters
- $var : string
__set()
Attribute setter (deprecated)
public
__set(string $var, mixed $value) : mixed
Parameters
- $var : string
- $value : mixed
__toArray()
Convert object attributes to array
public
__toArray([array<string|int, mixed> $arrAttributes = [] ]) : array<string|int, mixed>
Parameters
- $arrAttributes : array<string|int, mixed> = []
-
array of required attributes
Return values
array<string|int, mixed>_getResource()
Get resource instance
public
_getResource() : Mage_Core_Model_Resource_Store
Return values
Mage_Core_Model_Resource_StoreaddData()
Add data to the object.
public
addData(array<string|int, mixed> $arr) : $this
Retains previous data in the object.
Parameters
- $arr : array<string|int, mixed>
Return values
$thisafterCommitCallback()
Callback function which called after transaction commit in resource model
public
afterCommitCallback() : $this
Return values
$thisafterLoad()
Object after load processing. Implemented as public interface for supporting objects after load in collections
public
afterLoad() : $this
Return values
$thiscleanModelCache()
Remove model object related cache
public
cleanModelCache() : $this
Return values
$thisclearCurrencyRateMemos()
Drop the memos answered from the rate table, after the table changed.
public
clearCurrencyRateMemos() : static
Return values
staticclearCurrentCurrency()
Drop every memo derived from the display currency, or the next switch lands one request late. The session choice survives, and a store object outliving the request in a worker runtime is undone here.
public
clearCurrentCurrency() : static
Return values
staticclearInstance()
Clearing object for correct deleting by garbage collector
public
final clearInstance() : $this
Return values
$thisconvertPrice()
Convert price from default currency to current currency
public
convertPrice(float $price[, bool $format = false ][, bool $includeContainer = true ]) : float
Parameters
- $price : float
- $format : bool = false
-
Format price to currency format
- $includeContainer : bool = true
-
Enclose into
Return values
floatdataHasChangedFor()
Compare object data with original data
public
dataHasChangedFor(string $field) : bool
Parameters
- $field : string
Return values
booldebug()
Present object data as string in debug mode
public
debug([mixed $data = null ][, array<string|int, mixed> &$objects = [] ]) : string|array<string|int, mixed>
Parameters
- $data : mixed = null
- $objects : array<string|int, mixed> = []
Return values
string|array<string|int, mixed>delete()
Delete object from database
public
delete() : $this
Tags
Return values
$thisflagDirty()
public
flagDirty(string $field[, bool $flag = true ]) : $this
Parameters
- $field : string
- $flag : bool = true
Return values
$thisformatPrice()
Format price with currency filter (taking rate into consideration)
public
formatPrice(float $price[, bool $includeContainer = true ]) : string|float
Parameters
- $price : float
- $includeContainer : bool = true
Return values
string|floatgetAvailableCurrencyCodes()
Get allowed store currency codes
public
getAvailableCurrencyCodes([bool $skipBaseNotAllowed = false ]) : array<string|int, mixed>
If base currency is not allowed in current website config scope, then it can be disabled with $skipBaseNotAllowed
Parameters
- $skipBaseNotAllowed : bool = false
Return values
array<string|int, mixed>getBaseCurrency()
Retrieve store base currency
public
getBaseCurrency() : Mage_Directory_Model_Currency
Return values
Mage_Directory_Model_CurrencygetBaseCurrencyCode()
Retrieve store base currency code
public
getBaseCurrencyCode() : string
Return values
stringgetBaseUrl()
Retrieve base URL
public
getBaseUrl([self::URL_TYPE_* $type = self::URL_TYPE_LINK ][, bool|null $secure = null ]) : string
Parameters
- $type : self::URL_TYPE_* = self::URL_TYPE_LINK
- $secure : bool|null = null
Return values
stringgetBillingAddress()
public
getBillingAddress() : Mage_Customer_Model_Address_Abstract|null
Return values
Mage_Customer_Model_Address_Abstract|nullgetCacheIdTags()
Get cache tags associated with object id
public
getCacheIdTags() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|falsegetCacheTags()
Get list of cache tags applied to model object.
public
getCacheTags() : array<string|int, mixed>|false
Return false if cache tags are not supported by model
Return values
array<string|int, mixed>|falsegetCode()
Retrieve Store code
public
getCode() : string
Return values
stringgetCollection()
public
getCollection() : Mage_Core_Model_Resource_Store_Collection
Return values
Mage_Core_Model_Resource_Store_CollectiongetConfig()
Retrieve store configuration data
public
getConfig(string $path) : string|null
Parameters
- $path : string
Return values
string|nullgetConfigCache()
Get the basic configuration nodes for this store view
public
getConfigCache() : array<string|int, mixed>
Return values
array<string|int, mixed>getCreatedAt()
public
getCreatedAt() : string|null
Return values
string|nullgetCurrentCurrency()
Retrieve store current currency
public
getCurrentCurrency() : Mage_Directory_Model_Currency
Return values
Mage_Directory_Model_CurrencygetCurrentCurrencyCode()
Get current store currency code
public
getCurrentCurrencyCode() : string
Resolved through getCurrentCurrency(), so the code and the currency object can never name different currencies.
Return values
stringgetCurrentCurrencyRate()
The rate the displayed currency was chosen with.
public
getCurrentCurrencyRate() : float
Tags
Return values
floatgetCurrentUrl()
Retrieve current url for store
public
getCurrentUrl([bool|string $fromStore = true ]) : string
Parameters
- $fromStore : bool|string = true
Return values
stringgetData()
Object data getter
public
getData([string $key = '' ][, string|int $index = null ]) : mixed
If $key is not defined will return all the data as an array. Otherwise, it will return value of the element specified by $key. It is possible to use keys like a/b/c for access nested array data
If $index is specified it will assume that attribute data is an array and retrieve corresponding member. If data is the string - it will be explode by new line character and converted to array.
Parameters
- $key : string = ''
- $index : string|int = null
getDataByKey()
Get object data by particular key
public
getDataByKey(string $key) : mixed
Parameters
- $key : string
getDataByPath()
Get object data by path
public
getDataByPath(string $path) : mixed
Method consider the path as chain of keys: a/b/c => ['a']['b']['c']
Parameters
- $path : string
getDataSetDefault()
Fast get data or set default if value is not available
public
getDataSetDefault(string $key, mixed $default) : mixed
Parameters
- $key : string
- $default : mixed
getDataUsingMethod()
Get object data by key with calling getter method
public
getDataUsingMethod(string $key[, mixed $args = null ]) : mixed
Parameters
- $key : string
- $args : mixed = null
getDefaultBasePath()
Retrieve default base path
public
getDefaultBasePath() : string
Return values
stringgetDefaultCurrency()
Retrieve store default currency
public
getDefaultCurrency() : Mage_Directory_Model_Currency
Return values
Mage_Directory_Model_CurrencygetDefaultCurrencyCode()
Get default store currency code
public
getDefaultCurrencyCode() : string
Return values
stringgetDefaultGroupId()
Retrieve default group identifier
public
getDefaultGroupId() : int|string|null
Return values
int|string|nullgetEntityId()
public
getEntityId() : int
Return values
intgetFrontendName()
Retrieve storegroup name
public
getFrontendName() : string
Return values
stringgetGroup()
Retrieve group model
public
getGroup() : Mage_Core_Model_Store_Group|false
Return values
Mage_Core_Model_Store_Group|falsegetGroupId()
Retrieve group identifier
public
getGroupId() : int
Return values
intgetHomeUrl()
public
getHomeUrl() : string|null
Return values
string|nullgetId()
Get store identifier
public
getId() : int|null
Attributes
- #[Override]
Return values
int|nullgetIdFieldName()
Retrieve identifier field name for model
public
getIdFieldName() : string
Attributes
- #[Override]
Return values
stringgetIsActive()
Check if store is active
public
getIsActive() : bool|null
Return values
bool|nullgetLanguageCode()
public
getLanguageCode() : string|null
Return values
string|nullgetLocaleCode()
public
getLocaleCode() : string|null
Return values
string|nullgetName()
Retrieve store name
public
getName() : string|null
Return values
string|nullgetOrigData()
Get object loaded data (original data)
public
getOrigData([string $key = null ]) : mixed
Parameters
- $key : string = null
getPriceFilter()
Get store price filter
public
getPriceFilter() : Mage_Directory_Model_Currency_Filter|Sprintf
Return values
Mage_Directory_Model_Currency_Filter|SprintfgetRequestedCurrencyCode()
The display currency asked for by session or configuration, before the no-rate fallback in getCurrentCurrency() has a say.
public
getRequestedCurrencyCode() : string
Return values
stringgetResource()
Retrieve model resource
public
getResource() : Mage_Core_Model_Resource_Store
Return values
Mage_Core_Model_Resource_StoregetResourceCollection()
Get collection instance
public
getResourceCollection() : Mage_Core_Model_Resource_Store_Collection
Return values
Mage_Core_Model_Resource_Store_CollectiongetResourceName()
Retrieve model resource name
public
getResourceName() : string
Return values
stringgetRootCategoryId()
Retrieve root category identifier
public
getRootCategoryId() : int
Return values
intgetRootCategoryPath()
public
getRootCategoryPath() : string|null
Return values
string|nullgetServeableCurrencyRates()
The allowed currencies this store can actually serve, mapped to their rate against base. An allowed currency with no usable rate is not one of them: getCurrentCurrency() falls back to base for it, and where base is not serveable either the store cannot sell at all. Base needs no rate row of its own, but it does have to be allowed.
public
getServeableCurrencyRates() : array<string, float>
The single definition of "serveable", so the API listing, the X-Currency-Code header and the storefront switcher cannot drift apart.
Return values
array<string, float>getShippingAddress()
public
getShippingAddress() : Mage_Customer_Model_Address_Abstract|null
Return values
Mage_Customer_Model_Address_Abstract|nullgetSortOrder()
public
getSortOrder() : int|null
Return values
int|nullgetStoreId()
public
getStoreId() : int|null
Return values
int|nullgetStoreInUrl()
Returns whether url forming scheme prepends url path with store view code.
public
getStoreInUrl() : bool
The admin store is always exempt: admin URLs are prefixed with the admin frontName (configured via admin/base_path or use_custom_admin_path) at the routing layer, not with the store code. Adding the admin store's code on top would produce doubled URLs like /admin/admin/index/index/.
Return values
boolgetUrl()
Retrieve url using store configuration specific
public
getUrl([string $route = '' ][, array<string|int, mixed> $params = [] ]) : string
Parameters
- $route : string = ''
- $params : array<string|int, mixed> = []
Return values
stringgetWebsite()
Retrieve store website
public
getWebsite() : Mage_Core_Model_Website|false
Return values
Mage_Core_Model_Website|falsegetWebsiteId()
Retrieve website identifier
public
getWebsiteId() : int
Return values
inthasData()
If $key is empty, checks whether there's any data in the object Otherwise checks if the specified attribute is set.
public
hasData([string $key = '' ]) : bool
Parameters
- $key : string = ''
Return values
boolhasDataChanges()
Get data change status
public
hasDataChanges() : bool
Return values
boolhasErrors()
public
hasErrors() : bool
Return values
boolisAdmin()
Check if store is admin store
public
isAdmin() : bool
Return values
boolisAdminUrlSecure()
Check if backend URLs should be secure
public
isAdminUrlSecure() : bool
Return values
boolisCanDelete()
Check if store can be deleted
public
isCanDelete() : bool
Return values
boolisDeleted()
Set _isDeleted flag value (if $isDeleted param is defined) and return current flag value
public
isDeleted([bool $isDeleted = null ]) : bool
Parameters
- $isDeleted : bool = null
Return values
boolisDirty()
public
isDirty([string $field = null ]) : bool
Parameters
- $field : string = null
Return values
boolisEmpty()
checks whether the object is empty
public
isEmpty() : bool
Return values
boolisFrontUrlSecure()
Check if frontend URLs should be secure
public
isFrontUrlSecure() : bool
Return values
boolisModuleEnabled()
public
isModuleEnabled(string $moduleName[, string $helperAlias = 'core' ]) : bool
Parameters
- $moduleName : string
- $helperAlias : string = 'core'
Return values
boolisObjectNew()
Check object state (true - if it is object without id on object just created) This method can help detect if object just created in _afterSave method problem is what in after save object has id and we can't detect what object was created in this transaction
public
isObjectNew([bool $flag = null ]) : bool
Parameters
- $flag : bool = null
Return values
boolisReadOnly()
Get/Set isReadOnly flag
public
isReadOnly([bool $value = null ]) : bool
Parameters
- $value : bool = null
Return values
booljsonSerialize()
Implementation of JsonSerializable::jsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Prepares the object data for JSON serialization. Returns all object data as an array, with special handling for nested DataObject instances:
- If a nested DataObject has a custom jsonSerialize() implementation, it's preserved as-is
- If a nested DataObject has a custom toJson() method, it's converted to JSON string
- If a nested DataObject uses only the base implementations, it's excluded from output
This prevents infinite recursion and circular references when serializing object hierarchies.
Attributes
- #[Override]
Return values
array<string|int, mixed>load()
Load object data
public
load(mixed $id[, mixed $field = null ]) : $this
Parameters
- $id : mixed
- $field : mixed = null
Attributes
- #[Override]
Return values
$thisloadConfig()
Loading store configuration data
public
loadConfig(string $code) : $this
Parameters
- $code : string
Return values
$thisoffsetExists()
Implementation of ArrayAccess::offsetExists()
public
offsetExists(string $offset) : bool
Parameters
- $offset : string
Tags
Attributes
- #[Override]
Return values
booloffsetGet()
Implementation of ArrayAccess::offsetGet()
public
offsetGet(string $offset) : mixed
Parameters
- $offset : string
Tags
Attributes
- #[Override]
- #[ReturnTypeWillChange]
offsetSet()
Implementation of ArrayAccess::offsetSet()
public
offsetSet(string $offset, mixed $value) : void
Parameters
- $offset : string
- $value : mixed
Tags
Attributes
- #[Override]
offsetUnset()
Implementation of ArrayAccess::offsetUnset()
public
offsetUnset(string $offset) : void
Parameters
- $offset : string
Tags
Attributes
- #[Override]
resetConfig()
Reinit and reset Config Data
public
resetConfig() : $this
Return values
$thisroundPrice()
Round price
public
roundPrice(mixed $price) : float
Parameters
- $price : mixed
Return values
floatsave()
Save object data
public
save() : $this
Tags
Return values
$thisserialize()
serialize object attributes
public
serialize([array<string|int, mixed> $attributes = [] ][, string $valueSeparator = '=' ][, string $fieldSeparator = ' ' ][, string $quote = '"' ]) : string
Parameters
- $attributes : array<string|int, mixed> = []
- $valueSeparator : string = '='
- $fieldSeparator : string = ' '
- $quote : string = '"'
Return values
stringsetAttribute()
public
setAttribute(Mage_Eav_Model_Entity_Attribute_Abstract $value) : $this
Parameters
Return values
$thissetCode()
public
setCode(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetConfig()
Set config value for CURRENT model
public
setConfig(string $path, mixed $value) : $this
This value don't save in config
Parameters
- $path : string
- $value : mixed
Return values
$thissetConfigCache()
Sets the internal configuration cache for this store view
public
setConfigCache(array<string|int, mixed> $data) : $this
Parameters
- $data : array<string|int, mixed>
Return values
$thissetCreatedAt()
public
setCreatedAt(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetCurrentCurrencyCode()
Set current store currency code
public
setCurrentCurrencyCode(string $code) : $this
Records an explicit shopper choice: applied for this request and written to the session. To apply a currency for this request alone, use setRequestedCurrencyCode().
Parameters
- $code : string
Return values
$thissetData()
Overwrite data in the object.
public
setData(string|array<string|int, mixed> $key[, mixed $value = null ]) : $this
$key can be string or array. If $key is string, the attribute value will be overwritten by $value
If $key is an array, it will overwrite all the data in the object.
Parameters
- $key : string|array<string|int, mixed>
- $value : mixed = null
Return values
$thissetDataChanges()
Clears data changes status
public
setDataChanges(bool $value) : $this
Parameters
- $value : bool
Return values
$thissetDataUsingMethod()
Set object data with calling setter method
public
setDataUsingMethod(string $key[, mixed $args = [] ]) : $this
Parameters
- $key : string
- $args : mixed = []
Return values
$thissetGroup()
Set group model for store
public
setGroup(Mage_Core_Model_Store_Group $group) : mixed
Parameters
- $group : Mage_Core_Model_Store_Group
setGroupId()
public
setGroupId(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetHomeUrl()
public
setHomeUrl(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetId()
Declare model object identifier value
public
setId(mixed $id) : $this
Parameters
- $id : mixed
Attributes
- #[Override]
Return values
$thissetIdFieldName()
set name of object id field
public
setIdFieldName(string $name) : $this
Parameters
- $name : string
Return values
$thissetIsActive()
public
setIsActive([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetLocaleCode()
public
setLocaleCode(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetName()
public
setName(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetOrigData()
Initialize object original data
public
setOrigData([string $key = null ][, mixed $data = null ]) : $this
Parameters
- $key : string = null
- $data : mixed = null
Return values
$thissetRequestedCurrencyCode()
Apply a display currency for this request alone: in-memory only, the session is never written, so a choice recorded there survives.
public
setRequestedCurrencyCode(string $code) : static
Parameters
- $code : string
Return values
staticsetRootCategory()
public
setRootCategory(DataObject|null $value) : static
Parameters
- $value : DataObject|null
Return values
staticsetRootCategoryPath()
public
setRootCategoryPath(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetSortOrder()
public
setSortOrder(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetStoreId()
public
setStoreId(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetUpdatedAt()
public
setUpdatedAt(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetWebsite()
Set website model
public
setWebsite(Mage_Core_Model_Website $website) : mixed
Parameters
- $website : Mage_Core_Model_Website
setWebsiteId()
public
setWebsiteId(int|null $value) : static
Parameters
- $value : int|null
Return values
statictoArray()
Public wrapper for __toArray
public
toArray([array<string|int, mixed> $arrAttributes = [] ]) : array<string|int, mixed>
Parameters
- $arrAttributes : array<string|int, mixed> = []
Return values
array<string|int, mixed>toJson()
Public wrapper for __toJson
public
toJson([array<string|int, mixed> $arrAttributes = [] ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
Return values
stringtoString()
Public wrapper for __toString
public
toString([string $format = '' ]) : string
Will use $format as an template and substitute {{key}} for attributes
Parameters
- $format : string = ''
Return values
stringtoXml()
Public wrapper for __toXml
public
toXml([array<string|int, mixed> $arrAttributes = [] ][, string $rootName = 'item' ][, bool $addOpenTag = false ][, bool $addCdata = true ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
- $rootName : string = 'item'
- $addOpenTag : bool = false
- $addCdata : bool = true
Return values
stringunsetData()
Unset data from the object.
public
unsetData([string $key = null ]) : $this
$key can be a string only. Array will be ignored.
Parameters
- $key : string = null
Return values
$thisunsetOldData()
Unset old fields data from the object.
public
unsetOldData([string $key = null ]) : $this
$key can be a string only. Array will be ignored.
Parameters
- $key : string = null
Return values
$this__toJson()
Convert object attributes to JSON
protected
__toJson([array<string|int, mixed> $arrAttributes = [] ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
-
array of required attributes
Return values
string__toXml()
Convert object attributes to XML
protected
__toXml([array<string|int, mixed> $arrAttributes = [] ][, string $rootName = 'item' ][, bool $addOpenTag = false ][, bool $addCdata = true ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
-
array of required attributes
- $rootName : string = 'item'
-
name of the root element
- $addOpenTag : bool = false
- $addCdata : bool = true
Return values
string_addFullNames()
protected
_addFullNames() : mixed
_afterDelete()
rewrite in order to clear configuration cache
protected
_afterDelete() : $this
Attributes
- #[Override]
Return values
$this_afterDeleteCommit()
Init indexing process after store delete commit
protected
_afterDeleteCommit() : $this
Attributes
- #[Override]
Return values
$this_afterLoad()
Processing object after load data
protected
_afterLoad() : $this
Return values
$this_afterSave()
Processing object after save data
protected
_afterSave() : $this
Return values
$this_beforeDelete()
Protect delete from non admin area Register indexing event before delete store
protected
_beforeDelete() : $this
Attributes
- #[Override]
Return values
$this_beforeLoad()
Processing object before load data
protected
_beforeLoad(int $id[, string|null $field = null ]) : $this
Parameters
- $id : int
- $field : string|null = null
Return values
$this_beforeSave()
Processing object before save data
protected
_beforeSave() : $this
Return values
$this_camelize()
protected
_camelize(string $name) : string
Parameters
- $name : string
Return values
string_clearData()
Clearing object's data
protected
_clearData() : $this
Return values
$this_clearReferences()
Clearing cyclic references
protected
_clearReferences() : $this
Return values
$this_construct()
Initialize object
protected
_construct() : void
Attributes
- #[Override]
_getData()
Get value from _data array without parse key
protected
_getData(string $key) : mixed
Parameters
- $key : string
_getEventData()
Get array of objects transferred to default events processing
protected
_getEventData() : array<string|int, mixed>
Return values
array<string|int, mixed>_getSession()
Retrieve store session object
protected
_getSession() : Mage_Core_Model_Session
Return values
Mage_Core_Model_Session_hasModelChanged()
Check whether model has changed data.
protected
_hasModelChanged() : bool
Can be overloaded in child classes to perform advanced check whether model needs to be saved e.g. using resourceModel->hasDataChanged() or any other technique
Return values
bool_init()
Standard model initialization
protected
_init(string $resourceModel) : mixed
Parameters
- $resourceModel : string
_initOldFieldsMap()
Inits mapping array of object's previously used fields to new fields.
protected
_initOldFieldsMap() : mixed
Must be overloaded by descendants to set concrete fields map.
_normalizeCurrencyCode()
Configured codes are brought to the one spelling every rate answer is keyed on.
protected
_normalizeCurrencyCode(string $code) : string
Parameters
- $code : string
Return values
string_prepareArray()
Set required array elements
protected
_prepareArray(array<string|int, mixed> &$arr[, array<string|int, mixed> $elements = [] ]) : array<string|int, mixed>
Parameters
- $arr : array<string|int, mixed>
- $elements : array<string|int, mixed> = []
Return values
array<string|int, mixed>_prepareSyncFieldsMap()
Called after old fields are inited. Forms synchronization map to sync old fields and new fields between each other.
protected
_prepareSyncFieldsMap() : $this
Return values
$this_processConfigValue()
Process config value
protected
_processConfigValue(string $fullPath, string $path, Element $node) : array<string|int, mixed>|string
Parameters
- $fullPath : string
- $path : string
- $node : Element
Return values
array<string|int, mixed>|string_protectFromNonAdmin()
Safeguard func that will check, if we are in admin area
protected
_protectFromNonAdmin() : mixed
Tags
_setResourceModel()
Set resource names
protected
_setResourceModel(string $resourceName[, string|null $resourceCollectionName = null ]) : mixed
If collection name is omitted, resource name will be used with _collection appended
Parameters
- $resourceName : string
- $resourceCollectionName : string|null = null
_underscore()
Converts field names for setters and getters
protected
_underscore(string $name) : string
$this->setMyField($value) === $this->setData('my_field', $value) Uses cache to eliminate unnecessary preg_replace
Parameters
- $name : string
Return values
string_updatePathUseStoreView()
Add store code to url in case if it is enabled in configuration
protected
_updatePathUseStoreView(string $url) : string
Parameters
- $url : string