Mage_Catalog_Model_Category
extends Mage_Catalog_Model_Abstract
in package
Catalog category
Table of Contents
Constants
- CACHE_TAG : mixed = 'catalog_category'
- DEFAULT_STORE_ID : mixed = 0
- Identifier of default store used for loading default data for entity
- DM_MIXED : mixed = 'PRODUCTS_AND_PAGE'
- DM_PAGE : mixed = 'PAGE'
- DM_PRODUCT : mixed = 'PRODUCTS'
- Category display modes
- ENTITY : mixed = 'catalog_category'
- Entity code.
- IMAGE_FALLBACK_ATTRIBUTE : mixed = 'image'
- Product attribute the fallback category image is taken from
- TREE_ROOT_ID : mixed = 1
- XML_PATH_IMAGE_FALLBACK : mixed = 'catalog/frontend/category_image_fallback'
- Store config flag enabling the product-derived category image fallback
Properties
- $_cacheTag : mixed
- Model cache tag for clear cache in after save and after delete
- $_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
- $_defaultValues : array<string|int, mixed>
- Attribute default values
- $_dirty : array<string|int, mixed>
- $_eventObject : string
- Parameter name in event
- $_eventPrefix : string
- Prefix of model events names
- $_hasDataChanges : bool
- Data changes flag (true after setData|unsetData call)
- $_idFieldName : string
- Name of object id field
- $_isDeleteable : bool
- Is model deletable
- $_isDeleted : bool
- Object delete flag
- $_isObjectNew : bool|null
- Flag which allow detect object state: is it new object (without id) or existing one (with id)
- $_isReadonly : bool
- Is model readonly
- $_lockedAttributes : array<string|int, mixed>
- Locked attributes
- $_oldFieldsMap : array<string|int, mixed>
- Map short fields names to its full names
- $_origData : array<string|int, mixed>|null
- Original data that was loaded
- $_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
- $_storeValuesFlags : array<string|int, mixed>
- This array contains codes of attributes which have value in current store
- $_syncFieldsMap : mixed
- Map of fields to sync to other fields upon changing their data
- $_treeModel : Mage_Catalog_Model_Resource_Category_Tree|null
- Category tree model
- $_underscoreCache : array<string|int, mixed>
- Setter/Getter underscore transformation cache
- $_url : Mage_Core_Model_Url
- URL Model instance
- $_urlModel : Mage_Catalog_Model_Category_Url
- Category Url instance
- $_urlRewrite : Mage_Core_Model_Url_Rewrite
- URL rewrite model
- $_designAttributes : array<string|int, mixed>
- Category design attributes
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_Catalog_Model_Resource_Category
- 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
- checkId() : bool
- Check category id existing
- cleanModelCache() : $this
- Remove model object related cache
- clearInstance() : $this
- Clearing object for correct deleting by garbage collector
- 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
- formatUrlKey() : string
- Format Key for URL
- getAffectedCategoryIds() : array<string|int, mixed>|null
- getAffectedProductIds() : array<string|int, mixed>|null
- getAllChildren() : array<string|int, mixed>|string
- Get all children categories IDs
- getAnchorsAbove() : array<string|int, mixed>
- Retrieve anchors above
- getAttributeDefaultValue() : array<string|int, mixed>|false
- Retrieve default value for attribute code
- getAttributes() : array<string|int, mixed>
- Retrieve all customer attributes
- getAvailableSortBy() : null|array<string|int, mixed>
- Retrieve Available int Product Listing sort by
- getAvailableSortByOptions() : array<string|int, mixed>
- Retrieve Available Product Listing Sort By code as key, value - name
- 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.
- getCategories() : array<string|int, mixed>|Mage_Catalog_Model_Resource_Category_Collection|Collection|Collection
- Retrieve categories by parent
- getCategoryIdUrl() : string
- Retrieve category id URL
- getCategoryPath() : string|null
- getCategoryUrl() : string|null
- getChildren() : string
- Retrieve children ids comma separated
- getChildrenCategories() : Mage_Catalog_Model_Resource_Category_Collection
- Return children categories of current category
- getChildrenCategoriesWithInactive() : Mage_Catalog_Model_Resource_Category_Collection
- Return children categories of current category
- getChildrenCount() : int|null
- getCollection() : Mage_Catalog_Model_Resource_Category_Collection
- getCreatedAt() : string|null
- getCustomDesignDate() : array<string|int, mixed>
- Retrieve dates for custom design (from & to)
- getCustomUseParentSettings() : int|null
- 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
- getDefaultAttributeSetId() : int
- Retrieve default attribute set id
- getDefaultSortBy() : string
- Retrieve Product Listing Default Sort By
- getDesignAttributes() : array<string|int, mixed>
- Retrieve design attributes array
- getDisplayMode() : string|null
- getEntityId() : int
- getExistsStoreValueFlag() : bool
- Check if object attribute has value in current store
- getFallbackImage() : string|null
- Retrieve the product image file standing in for a category that has no image of its own.
- getId() : int|string|null
- Retrieve model object identifier
- getIdFieldName() : string
- Retrieve identifier field name for model
- getImage() : string|null
- getImagePath() : string
- getImageSize() : array{0: int, 1: int}|null
- Width and height of the image, or null when it cannot be read. A remote mount reads the file once and keeps the size in the cache, so a page render does not download it.
- getImageStoragePath() : string|null
- Mount path of the image on the media mount, the category's own or the product image it falls back to. Null when there is none or when the stored name leaves its directory.
- getImageUrl() : string
- Retrieve image URL
- getInitialSetupFlag() : bool|null
- getIsActive() : int|null
- getIsAnchor() : int|null
- getLandingPage() : int|null
- getLayoutUpdateHandle() : string
- Retrieve Layout Update Handle name
- getLevel() : int
- Retrieve level
- getLockedAttributes() : array<string|int, mixed>
- Retrieve locked attributes
- getMetaDescription() : string|null
- getMetaKeywords() : string|null
- getMetaTitle() : string|null
- getMovedCategoryId() : int|null
- getName() : string
- Retrieve Name data wrapper
- getOrigData() : mixed
- Get object loaded data (original data)
- getParentCategories() : array<string|int, Mage_Catalog_Model_Category>
- Return parent categories of current category
- getParentCategory() : $this
- Get parent category object
- getParentDesignCategory() : Mage_Catalog_Model_Category
- Return parent category of current category with own custom design settings
- getParentId() : int
- Get parent category identifier
- getParentIds() : array<string|int, mixed>
- Get all parent categories ids
- getPath() : string|null
- getPathIds() : array<string|int, mixed>
- Get array categories ids which are part of category path Result array contain id of current category because it is part of the path
- getPathInStore() : string
- Retrieve Stores where isset category Path Return comma separated string
- getPosition() : int|null
- getPostedProducts() : array<string|int, mixed>|null
- getProductCollection() : Mage_Catalog_Model_Resource_Product_Collection
- Get category products collection
- getProductCount() : int
- Retrieve count products of category
- getProductsPosition() : array<string|int, mixed>
- Retrieve array of product id's for category
- getProductsReadonly() : bool|null
- getRequestPath() : string
- Retrieve Request Path
- getResource() : Mage_Catalog_Model_Resource_Category
- Retrieve model resource
- getResourceCollection() : Mage_Catalog_Model_Resource_Collection_Abstract
- Get collection instance
- getResourceName() : string
- Retrieve model resource name
- getShippingAddress() : Mage_Customer_Model_Address_Abstract|null
- getStore() : Mage_Core_Model_Store
- Retrieve sore object
- getStoreId() : int
- Return store id.
- getStoreIds() : array<string|int, mixed>
- Retrieve array of store ids for category
- getTreeModel() : Mage_Catalog_Model_Resource_Category_Tree
- Retrieve category tree model
- getTreeModelInstance() : Mage_Catalog_Model_Resource_Category_Tree
- getUrl() : string
- Get category url
- getUrlInstance() : Mage_Core_Model_Url
- Retrieve URL instance
- getUrlKey() : string|null
- getUrlModel() : Mage_Catalog_Model_Category_Url
- Get product url model
- getUrlPath() : string
- Retrieve URL path
- getUrlRewrite() : Mage_Core_Model_Url_Rewrite
- Get url rewrite model
- getWebsiteStoreIds() : array<string|int, mixed>
- Retrieve all store ids of object current website
- hasChildren() : bool
- Retrieve Is Category has children flag
- 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
- hasLevel() : bool
- hasLockedAttributes() : bool
- Checks that model have locked attributes
- hasProductCount() : bool
- isDeleteable() : bool
- Checks model is deletable
- 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
- isInRootCategoryList() : bool
- Check category is in Root Category list
- isLockedAttribute() : bool
- Retrieve locked attributes
- 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
- Checks model is deletable
- jsonSerialize() : array<string|int, mixed>
- Implementation of JsonSerializable::jsonSerialize()
- load() : $this
- Load object data
- loadByAttribute() : false|$this
- Load entity by attribute
- lockAttribute() : $this
- Lock attribute
- move() : Mage_Catalog_Model_Category
- Move category
- offsetExists() : bool
- Implementation of ArrayAccess::offsetExists()
- offsetGet() : mixed
- Implementation of ArrayAccess::offsetGet()
- offsetSet() : void
- Implementation of ArrayAccess::offsetSet()
- offsetUnset() : void
- Implementation of ArrayAccess::offsetUnset()
- save() : $this
- Save object data
- serialize() : string
- serialize object attributes
- setAffectedCategoryIds() : static
- setAffectedProductIds() : static
- setAttribute() : $this
- setAttributeDefaultValue() : $this
- Adding attribute code and value to default value registry
- setAttributeSetId() : static
- setChildrenCount() : static
- setCreatedAt() : static
- setData() : $this
- Overwrite data in the object.
- setDataChanges() : $this
- Clears data changes status
- setDataUsingMethod() : $this
- Set object data with calling setter method
- setDeletedChildrenIds() : static
- setDisplayMode() : static
- setExistsStoreValueFlag() : $this
- Set attribute code flag if attribute has value in current store and does not use value of default store as value
- setId() : $this
- Declare model object identifier value
- setIdFieldName() : $this
- set name of object id field
- setIncludeInMenu() : static
- An int, not a bool: in catalog a false value is the "use default scope value" sentinel, so a required attribute set to false is read as missing.
- setInitialSetupFlag() : static
- setIsActive() : static
- An int, not a bool: in catalog a false value is the "use default scope value" sentinel, so a required attribute set to false is read as missing.
- setIsAnchor() : static
- An int, not a bool: in catalog a false value is the "use default scope value" sentinel, so a required attribute set to false is read as missing.
- setIsChangedProductList() : static
- setIsDeleteable() : $this
- Set is deletable flag
- setIsReadonly() : $this
- Set is deletable flag
- setLevel() : static
- setMovedCategoryId() : static
- setName() : static
- setOrigData() : $this
- Initialize object original data
- setParentId() : static
- setPath() : static
- setPosition() : static
- setPostedProducts() : static
- setStoreId() : $this
- Set store id
- setUpdatedAt() : static
- setUrlKey() : static
- setUrlPath() : 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
- unlockAttribute() : $this
- Unlock attribute
- unlockAttributes() : $this
- Unlock all attributes
- unsetData() : $this
- Unset data from the object.
- unsetOldData() : $this
- Unset old fields data from the object.
- unsExistsStoreValueFlag() : static
- validate() : true|array<string|int, mixed>
- Validate attribute values
- verifyIds() : array<string|int, mixed>
- Verify category ids
- __toJson() : string
- Convert object attributes to JSON
- __toXml() : string
- Convert object attributes to XML
- _addFullNames() : mixed
- _afterDelete() : $this
- Processing object after delete data
- _afterDeleteCommit() : $this
- Processing manipulation after main transaction commit
- _afterLoad() : $this
- Processing object after load data
- _afterSave() : $this
- Processing object after save data
- _beforeDelete() : $this
- Processing object before delete data
- _beforeLoad() : $this
- Processing object before load data
- _beforeSave() : $this
- Before save unlock attributes
- _cachedFallbackImage() : string|null
- Cache the lookup so a page rendering many image-less categories only pays for the query once per category, on the first render rather than on every one.
- _camelize() : string
- _clearData() : $this
- Clearing object's data
- _clearReferences() : $this
- Clearing cyclic references
- _construct() : void
- Initialize resource mode
- _getData() : mixed
- Get value from _data array without parse key
- _getEventData() : array<string|int, mixed>
- Get array of objects transferred to default events processing
- _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.
- _loadFallbackImage() : string|null
- Look up the image of the first visible, enabled product of this category.
- _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.
- _protectFromNonAdmin() : mixed
- Safeguard func that will check, if we are in admin area
- _sanitizeWysiwygAttributes() : void
- Sanitize the rich-text attributes of this entity (product description, category description, any custom WYSIWYG-enabled attribute).
- _setResourceModel() : mixed
- Set resource names
- _underscore() : string
- Converts field names for setters and getters
- _getAttribute() : Mage_Eav_Model_Entity_Attribute_Abstract
- Retrieve attribute by code
Constants
CACHE_TAG
public
mixed
CACHE_TAG
= 'catalog_category'
DEFAULT_STORE_ID
Identifier of default store used for loading default data for entity
public
mixed
DEFAULT_STORE_ID
= 0
DM_MIXED
public
mixed
DM_MIXED
= 'PRODUCTS_AND_PAGE'
DM_PAGE
public
mixed
DM_PAGE
= 'PAGE'
DM_PRODUCT
Category display modes
public
mixed
DM_PRODUCT
= 'PRODUCTS'
ENTITY
Entity code.
public
mixed
ENTITY
= 'catalog_category'
Can be used as part of method name for entity processing
IMAGE_FALLBACK_ATTRIBUTE
Product attribute the fallback category image is taken from
public
mixed
IMAGE_FALLBACK_ATTRIBUTE
= 'image'
TREE_ROOT_ID
public
mixed
TREE_ROOT_ID
= 1
XML_PATH_IMAGE_FALLBACK
Store config flag enabling the product-derived category image fallback
public
mixed
XML_PATH_IMAGE_FALLBACK
= 'catalog/frontend/category_image_fallback'
Properties
$_cacheTag
Model cache tag for clear cache in after save and after delete
protected
mixed
$_cacheTag
= self::CACHE_TAG
Attributes
- #[Override]
$_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
$_defaultValues
Attribute default values
protected
array<string|int, mixed>
$_defaultValues
= []
This array contain default values for attributes which was redefine value for store
$_dirty
protected
array<string|int, mixed>
$_dirty
$_eventObject
Parameter name in event
protected
string
$_eventObject
= 'category'
Attributes
- #[Override]
$_eventPrefix
Prefix of model events names
protected
string
$_eventPrefix
= 'catalog_category'
Attributes
- #[Override]
$_hasDataChanges
Data changes flag (true after setData|unsetData call)
protected
bool
$_hasDataChanges
= false
$_idFieldName
Name of object id field
protected
string
$_idFieldName
= null
$_isDeleteable
Is model deletable
protected
bool
$_isDeleteable
= \true
$_isDeleted
Object delete flag
protected
bool
$_isDeleted
= false
$_isObjectNew
Flag which allow detect object state: is it new object (without id) or existing one (with id)
protected
bool|null
$_isObjectNew
= \null
$_isReadonly
Is model readonly
protected
bool
$_isReadonly
= \false
$_lockedAttributes
Locked attributes
protected
array<string|int, mixed>
$_lockedAttributes
= []
$_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
$_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
$_storeValuesFlags
This array contains codes of attributes which have value in current store
protected
array<string|int, mixed>
$_storeValuesFlags
= []
$_syncFieldsMap
Map of fields to sync to other fields upon changing their data
protected
mixed
$_syncFieldsMap
= []
$_treeModel
Category tree model
protected
Mage_Catalog_Model_Resource_Category_Tree|null
$_treeModel
= \null
$_underscoreCache
Setter/Getter underscore transformation cache
protected
static array<string|int, mixed>
$_underscoreCache
= []
$_url
URL Model instance
protected
static Mage_Core_Model_Url
$_url
$_urlModel
Category Url instance
protected
Mage_Catalog_Model_Category_Url
$_urlModel
$_urlRewrite
URL rewrite model
protected
static Mage_Core_Model_Url_Rewrite
$_urlRewrite
$_designAttributes
Category design attributes
private
array<string|int, mixed>
$_designAttributes
= ['custom_design', 'custom_design_from', 'custom_design_to', 'page_layout', 'custom_layout_update', 'custom_apply_to_products']
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_Catalog_Model_Resource_Category
Return values
Mage_Catalog_Model_Resource_CategoryaddData()
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
Attributes
- #[Override]
Return values
$thisafterLoad()
Object after load processing. Implemented as public interface for supporting objects after load in collections
public
afterLoad() : $this
Return values
$thischeckId()
Check category id existing
public
checkId(int $id) : bool
Parameters
- $id : int
Return values
boolcleanModelCache()
Remove model object related cache
public
cleanModelCache() : $this
Return values
$thisclearInstance()
Clearing object for correct deleting by garbage collector
public
final clearInstance() : $this
Return values
$thisdataHasChangedFor()
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
$thisformatUrlKey()
Format Key for URL
public
formatUrlKey(string $str[, null|string $locale = null ]) : string
Parameters
- $str : string
- $locale : null|string = null
Return values
stringgetAffectedCategoryIds()
public
getAffectedCategoryIds() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetAffectedProductIds()
public
getAffectedProductIds() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetAllChildren()
Get all children categories IDs
public
getAllChildren([bool $asArray = false ]) : array<string|int, mixed>|string
Parameters
- $asArray : bool = false
-
return result as array instead of comma-separated list of IDs
Return values
array<string|int, mixed>|stringgetAnchorsAbove()
Retrieve anchors above
public
getAnchorsAbove() : array<string|int, mixed>
Return values
array<string|int, mixed>getAttributeDefaultValue()
Retrieve default value for attribute code
public
getAttributeDefaultValue(string $attributeCode) : array<string|int, mixed>|false
Parameters
- $attributeCode : string
Return values
array<string|int, mixed>|falsegetAttributes()
Retrieve all customer attributes
public
getAttributes([bool $noDesignAttributes = false ]) : array<string|int, mixed>
Parameters
- $noDesignAttributes : bool = false
Return values
array<string|int, mixed>getAvailableSortBy()
Retrieve Available int Product Listing sort by
public
getAvailableSortBy() : null|array<string|int, mixed>
Return values
null|array<string|int, mixed>getAvailableSortByOptions()
Retrieve Available Product Listing Sort By code as key, value - name
public
getAvailableSortByOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>getBillingAddress()
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>|falsegetCategories()
Retrieve categories by parent
public
getCategories(int $parent[, int $recursionLevel = 0 ][, bool $sorted = false ][, bool $asCollection = false ][, bool $toLoad = true ]) : array<string|int, mixed>|Mage_Catalog_Model_Resource_Category_Collection|Collection|Collection
Parameters
- $parent : int
- $recursionLevel : int = 0
- $sorted : bool = false
- $asCollection : bool = false
- $toLoad : bool = true
Return values
array<string|int, mixed>|Mage_Catalog_Model_Resource_Category_Collection|Collection|CollectiongetCategoryIdUrl()
Retrieve category id URL
public
getCategoryIdUrl() : string
Return values
stringgetCategoryPath()
public
getCategoryPath() : string|null
Return values
string|nullgetCategoryUrl()
public
getCategoryUrl() : string|null
Return values
string|nullgetChildren()
Retrieve children ids comma separated
public
getChildren() : string
Return values
stringgetChildrenCategories()
Return children categories of current category
public
getChildrenCategories() : Mage_Catalog_Model_Resource_Category_Collection
Return values
Mage_Catalog_Model_Resource_Category_CollectiongetChildrenCategoriesWithInactive()
Return children categories of current category
public
getChildrenCategoriesWithInactive() : Mage_Catalog_Model_Resource_Category_Collection
Return values
Mage_Catalog_Model_Resource_Category_CollectiongetChildrenCount()
public
getChildrenCount() : int|null
Return values
int|nullgetCollection()
public
getCollection() : Mage_Catalog_Model_Resource_Category_Collection
Return values
Mage_Catalog_Model_Resource_Category_CollectiongetCreatedAt()
public
getCreatedAt() : string|null
Return values
string|nullgetCustomDesignDate()
Retrieve dates for custom design (from & to)
public
getCustomDesignDate() : array<string|int, mixed>
Return values
array<string|int, mixed>getCustomUseParentSettings()
public
getCustomUseParentSettings() : int|null
Return values
int|nullgetData()
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
getDefaultAttributeSetId()
Retrieve default attribute set id
public
getDefaultAttributeSetId() : int
Return values
intgetDefaultSortBy()
Retrieve Product Listing Default Sort By
public
getDefaultSortBy() : string
Return values
stringgetDesignAttributes()
Retrieve design attributes array
public
getDesignAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>getDisplayMode()
public
getDisplayMode() : string|null
Return values
string|nullgetEntityId()
public
getEntityId() : int
Return values
intgetExistsStoreValueFlag()
Check if object attribute has value in current store
public
getExistsStoreValueFlag(string $attributeCode) : bool
Parameters
- $attributeCode : string
Return values
boolgetFallbackImage()
Retrieve the product image file standing in for a category that has no image of its own.
public
getFallbackImage() : string|null
The first product of the category by position wins, lowest entity id breaking ties. Resolved at runtime and never persisted, so it follows the catalog as it changes.
Return values
string|nullgetId()
Retrieve model object identifier
public
getId() : int|string|null
Attributes
- #[Override]
Return values
int|string|nullgetIdFieldName()
Retrieve identifier field name for model
public
getIdFieldName() : string
Attributes
- #[Override]
Return values
stringgetImage()
public
getImage() : string|null
Return values
string|nullgetImagePath()
public
getImagePath() : string
since 26.11 the file can be on a remote mount, use getImageStoragePath() or getImageSize()
Return values
stringgetImageSize()
Width and height of the image, or null when it cannot be read. A remote mount reads the file once and keeps the size in the cache, so a page render does not download it.
public
getImageSize() : array{0: int, 1: int}|null
Return values
array{0: int, 1: int}|nullgetImageStoragePath()
Mount path of the image on the media mount, the category's own or the product image it falls back to. Null when there is none or when the stored name leaves its directory.
public
getImageStoragePath() : string|null
Return values
string|nullgetImageUrl()
Retrieve image URL
public
getImageUrl() : string
Falls back to a product image when the category has none of its own.
Return values
stringgetInitialSetupFlag()
public
getInitialSetupFlag() : bool|null
Return values
bool|nullgetIsActive()
public
getIsActive() : int|null
Return values
int|nullgetIsAnchor()
public
getIsAnchor() : int|null
Return values
int|nullgetLandingPage()
public
getLandingPage() : int|null
Return values
int|nullgetLayoutUpdateHandle()
Retrieve Layout Update Handle name
public
getLayoutUpdateHandle() : string
Return values
stringgetLevel()
Retrieve level
public
getLevel() : int
Return values
intgetLockedAttributes()
Retrieve locked attributes
public
getLockedAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>getMetaDescription()
public
getMetaDescription() : string|null
Return values
string|nullgetMetaKeywords()
public
getMetaKeywords() : string|null
Return values
string|nullgetMetaTitle()
public
getMetaTitle() : string|null
Return values
string|nullgetMovedCategoryId()
public
getMovedCategoryId() : int|null
Return values
int|nullgetName()
Retrieve Name data wrapper
public
getName() : string
Return values
stringgetOrigData()
Get object loaded data (original data)
public
getOrigData([string $key = null ]) : mixed
Parameters
- $key : string = null
getParentCategories()
Return parent categories of current category
public
getParentCategories() : array<string|int, Mage_Catalog_Model_Category>
Return values
array<string|int, Mage_Catalog_Model_Category>getParentCategory()
Get parent category object
public
getParentCategory() : $this
Return values
$thisgetParentDesignCategory()
Return parent category of current category with own custom design settings
public
getParentDesignCategory() : Mage_Catalog_Model_Category
Return values
Mage_Catalog_Model_CategorygetParentId()
Get parent category identifier
public
getParentId() : int
Return values
intgetParentIds()
Get all parent categories ids
public
getParentIds() : array<string|int, mixed>
Return values
array<string|int, mixed>getPath()
public
getPath() : string|null
Return values
string|nullgetPathIds()
Get array categories ids which are part of category path Result array contain id of current category because it is part of the path
public
getPathIds() : array<string|int, mixed>
Return values
array<string|int, mixed>getPathInStore()
Retrieve Stores where isset category Path Return comma separated string
public
getPathInStore() : string
Return values
stringgetPosition()
public
getPosition() : int|null
Return values
int|nullgetPostedProducts()
public
getPostedProducts() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetProductCollection()
Get category products collection
public
getProductCollection() : Mage_Catalog_Model_Resource_Product_Collection
Return values
Mage_Catalog_Model_Resource_Product_CollectiongetProductCount()
Retrieve count products of category
public
getProductCount() : int
Return values
intgetProductsPosition()
Retrieve array of product id's for category
public
getProductsPosition() : array<string|int, mixed>
[$productId => $position]
Return values
array<string|int, mixed>getProductsReadonly()
public
getProductsReadonly() : bool|null
Return values
bool|nullgetRequestPath()
Retrieve Request Path
public
getRequestPath() : string
Return values
stringgetResource()
Retrieve model resource
public
getResource() : Mage_Catalog_Model_Resource_Category
Return values
Mage_Catalog_Model_Resource_CategorygetResourceCollection()
Get collection instance
public
getResourceCollection() : Mage_Catalog_Model_Resource_Collection_Abstract
Attributes
- #[Override]
Return values
Mage_Catalog_Model_Resource_Collection_AbstractgetResourceName()
Retrieve model resource name
public
getResourceName() : string
Return values
stringgetShippingAddress()
public
getShippingAddress() : Mage_Customer_Model_Address_Abstract|null
Return values
Mage_Customer_Model_Address_Abstract|nullgetStore()
Retrieve sore object
public
getStore() : Mage_Core_Model_Store
Return values
Mage_Core_Model_StoregetStoreId()
Return store id.
public
getStoreId() : int
If store id is undefined for category return current active store id
Attributes
- #[Override]
Return values
intgetStoreIds()
Retrieve array of store ids for category
public
getStoreIds() : array<string|int, mixed>
Return values
array<string|int, mixed>getTreeModel()
Retrieve category tree model
public
getTreeModel() : Mage_Catalog_Model_Resource_Category_Tree
Return values
Mage_Catalog_Model_Resource_Category_TreegetTreeModelInstance()
public
getTreeModelInstance() : Mage_Catalog_Model_Resource_Category_Tree
Return values
Mage_Catalog_Model_Resource_Category_TreegetUrl()
Get category url
public
getUrl() : string
Return values
stringgetUrlInstance()
Retrieve URL instance
public
getUrlInstance() : Mage_Core_Model_Url
Return values
Mage_Core_Model_UrlgetUrlKey()
public
getUrlKey() : string|null
Return values
string|nullgetUrlModel()
Get product url model
public
getUrlModel() : Mage_Catalog_Model_Category_Url
Return values
Mage_Catalog_Model_Category_UrlgetUrlPath()
Retrieve URL path
public
getUrlPath() : string
Return values
stringgetUrlRewrite()
Get url rewrite model
public
getUrlRewrite() : Mage_Core_Model_Url_Rewrite
Return values
Mage_Core_Model_Url_RewritegetWebsiteStoreIds()
Retrieve all store ids of object current website
public
getWebsiteStoreIds() : array<string|int, mixed>
Return values
array<string|int, mixed>hasChildren()
Retrieve Is Category has children flag
public
hasChildren() : bool
Return values
boolhasData()
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
boolhasLevel()
public
hasLevel() : bool
Return values
boolhasLockedAttributes()
Checks that model have locked attributes
public
hasLockedAttributes() : bool
Return values
boolhasProductCount()
public
hasProductCount() : bool
Return values
boolisDeleteable()
Checks model is deletable
public
isDeleteable() : 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
boolisInRootCategoryList()
Check category is in Root Category list
public
isInRootCategoryList() : bool
Return values
boolisLockedAttribute()
Retrieve locked attributes
public
isLockedAttribute(string $attributeCode) : bool
Parameters
- $attributeCode : string
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()
Checks model is deletable
public
isReadonly() : bool
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(string|null|int $id[, string|null $field = null ]) : $this
Parameters
- $id : string|null|int
- $field : string|null = null
Return values
$thisloadByAttribute()
Load entity by attribute
public
loadByAttribute(Mage_Eav_Model_Entity_Attribute_Interface|int|string|array<string|int, mixed> $attribute, null|string|array<string|int, mixed> $value[, string $additionalAttributes = '*' ]) : false|$this
Parameters
- $attribute : Mage_Eav_Model_Entity_Attribute_Interface|int|string|array<string|int, mixed>
- $value : null|string|array<string|int, mixed>
- $additionalAttributes : string = '*'
Return values
false|$thislockAttribute()
Lock attribute
public
lockAttribute(string $attributeCode) : $this
Parameters
- $attributeCode : string
Return values
$thismove()
Move category
public
move(int $parentId, int|null $afterCategoryId) : Mage_Catalog_Model_Category
Parameters
- $parentId : int
-
new parent category id
- $afterCategoryId : int|null
-
category id after which we have put current category
Return values
Mage_Catalog_Model_CategoryoffsetExists()
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]
save()
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
stringsetAffectedCategoryIds()
public
setAffectedCategoryIds(array<string|int, mixed>|null $value) : static
Parameters
- $value : array<string|int, mixed>|null
Return values
staticsetAffectedProductIds()
public
setAffectedProductIds(array<string|int, mixed>|null $value) : static
Parameters
- $value : array<string|int, mixed>|null
Return values
staticsetAttribute()
public
setAttribute(Mage_Eav_Model_Entity_Attribute_Abstract $value) : $this
Parameters
Return values
$thissetAttributeDefaultValue()
Adding attribute code and value to default value registry
public
setAttributeDefaultValue(string $attributeCode, string $value) : $this
Default value existing is flag for using store value in data
Parameters
- $attributeCode : string
- $value : string
Return values
$thissetAttributeSetId()
public
setAttributeSetId(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetChildrenCount()
public
setChildrenCount(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetCreatedAt()
public
setCreatedAt(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetData()
Overwrite data in the object.
public
setData(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.
$isChanged will specify if the object needs to be saved after an update.
Parameters
- $key : mixed
- $value : mixed = null
Attributes
- #[Override]
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
$thissetDeletedChildrenIds()
public
setDeletedChildrenIds(array<string|int, mixed>|null $value) : static
Parameters
- $value : array<string|int, mixed>|null
Return values
staticsetDisplayMode()
public
setDisplayMode(string|false|null $value) : static
Parameters
- $value : string|false|null
Return values
staticsetExistsStoreValueFlag()
Set attribute code flag if attribute has value in current store and does not use value of default store as value
public
setExistsStoreValueFlag(string $attributeCode) : $this
Parameters
- $attributeCode : string
Return values
$thissetId()
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
$thissetIncludeInMenu()
An int, not a bool: in catalog a false value is the "use default scope value" sentinel, so a required attribute set to false is read as missing.
public
setIncludeInMenu(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetInitialSetupFlag()
public
setInitialSetupFlag([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetIsActive()
An int, not a bool: in catalog a false value is the "use default scope value" sentinel, so a required attribute set to false is read as missing.
public
setIsActive(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetIsAnchor()
An int, not a bool: in catalog a false value is the "use default scope value" sentinel, so a required attribute set to false is read as missing.
public
setIsAnchor(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetIsChangedProductList()
public
setIsChangedProductList([bool|null $value = true ]) : static
Parameters
- $value : bool|null = true
Return values
staticsetIsDeleteable()
Set is deletable flag
public
setIsDeleteable(bool $value) : $this
Parameters
- $value : bool
Return values
$thissetIsReadonly()
Set is deletable flag
public
setIsReadonly(bool $value) : $this
Parameters
- $value : bool
Return values
$thissetLevel()
public
setLevel(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetMovedCategoryId()
public
setMovedCategoryId(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetName()
public
setName(string|false|null $value) : static
Parameters
- $value : string|false|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
$thissetParentId()
public
setParentId(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetPath()
public
setPath(string|int|null $value) : static
Parameters
- $value : string|int|null
Return values
staticsetPosition()
public
setPosition(int|null $value) : static
Parameters
- $value : int|null
Return values
staticsetPostedProducts()
public
setPostedProducts(array<string|int, mixed>|null $value) : static
Parameters
- $value : array<string|int, mixed>|null
Return values
staticsetStoreId()
Set store id
public
setStoreId(string|int|Mage_Core_Model_Store $storeId) : $this
Parameters
- $storeId : string|int|Mage_Core_Model_Store
Return values
$thissetUpdatedAt()
public
setUpdatedAt(string|null $value) : static
Parameters
- $value : string|null
Return values
staticsetUrlKey()
public
setUrlKey(string|false|null $value) : static
Parameters
- $value : string|false|null
Return values
staticsetUrlPath()
public
setUrlPath(string|false|null $value) : static
Parameters
- $value : string|false|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
stringunlockAttribute()
Unlock attribute
public
unlockAttribute(string $attributeCode) : $this
Parameters
- $attributeCode : string
Return values
$thisunlockAttributes()
Unlock all attributes
public
unlockAttributes() : $this
Return values
$thisunsetData()
Unset data from the object.
public
unsetData([mixed $key = null ]) : $this
$key can be a string only. Array will be ignored.
$isChanged will specify if the object needs to be saved after an update.
Parameters
- $key : mixed = null
Attributes
- #[Override]
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
$thisunsExistsStoreValueFlag()
public
unsExistsStoreValueFlag(string $attributeCode) : static
Parameters
- $attributeCode : string
Return values
staticvalidate()
Validate attribute values
public
validate() : true|array<string|int, mixed>
Tags
Return values
true|array<string|int, mixed>verifyIds()
Verify category ids
public
verifyIds(array<string|int, mixed> $ids) : array<string|int, mixed>
Parameters
- $ids : array<string|int, mixed>
Return values
array<string|int, mixed>__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()
Processing object after delete data
protected
_afterDelete() : $this
Return values
$this_afterDeleteCommit()
Processing manipulation after main transaction commit
protected
_afterDeleteCommit() : $this
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()
Processing object before delete data
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()
Before save unlock attributes
protected
_beforeSave() : $this
Attributes
- #[Override]
Return values
$this_cachedFallbackImage()
Cache the lookup so a page rendering many image-less categories only pays for the query once per category, on the first render rather than on every one.
protected
_cachedFallbackImage() : string|null
Tagged with both catalog entities: saving any product or category drops the entries, which is what keeps the derived image current without ever persisting it onto the category.
Return values
string|null_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 resource mode
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>_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.
_loadFallbackImage()
Look up the image of the first visible, enabled product of this category.
protected
_loadFallbackImage() : string|null
Return values
string|null_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_protectFromNonAdmin()
Safeguard func that will check, if we are in admin area
protected
_protectFromNonAdmin() : mixed
Tags
_sanitizeWysiwygAttributes()
Sanitize the rich-text attributes of this entity (product description, category description, any custom WYSIWYG-enabled attribute).
protected
_sanitizeWysiwygAttributes() : void
This covers the markup authored in the field. It is not a complete boundary: what a directive resolves to at render is not sanitized, so a crafted parameter — or a value pulled in by {{customvar}} or {{config}} — still reaches the page unescaped.
WYSIWYG-enabled attributes are exactly the ones Mage_Catalog_Helper_Output renders through the template processor, so they are the ones that may hold template directives — hence filterPreservingDirectives(), which sanitizes without mangling them. No link filtering: a description links to other pages of the same catalog.
Bulk import writes attribute values straight to the DB rather than through the model, so it is unaffected; admin, API and programmatic saves all pass through here.
_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_getAttribute()
Retrieve attribute by code
private
_getAttribute(string $attributeCode) : Mage_Eav_Model_Entity_Attribute_Abstract
Parameters
- $attributeCode : string