Category
Magento\Catalog\Model\Category
What it does
This is the core Category model in Magento 2 that represents a catalog category entity.
Developers use this class to create, read, update, and delete categories, manage category hierarchies (parent-child relationships), retrieve associated products, handle category URLs, and control category display settings.
It provides essential methods for category tree navigation, position management, and integration with Magento's indexing and caching systems.
Public Methods
- getUseFlatResource()
- getUrlInstance()
- getTreeModel()
- getTreeModelInstance()
- move()
- getDefaultAttributeSetId()
- getProductCollection()
- getAttributes()
- getProductsPosition()
- getStoreIds()
- getStoreId()
- setStoreId()
- getUrl()
- getCategoryIdUrl()
- formatUrlKey()
- getImageUrl()
- getParentCategory()
- getParentId()
- getParentIds()
- getCustomDesignDate()
- getDesignAttributes()
- getAllChildren()
- getChildren()
- getPathInStore()
- checkId()
- getPathIds()
- getLevel()
- verifyIds()
- hasChildren()
- getRequestPath()
- getName()
- beforeDelete()
- getAnchorsAbove()
- getProductCount()
- getCategories()
- getParentCategories()
- getChildrenCategories()
- getParentDesignCategory()
- isInRootCategoryList()
- getAvailableSortBy()
- getAvailableSortByOptions()
- getDefaultSortBy()
- validate()
- afterSave()
- getCacheTags()
- reindex()
- afterDeleteCommit()
- getIdentities()
- getPath()
- getPosition()
- getChildrenCount()
- getCreatedAt()
- getUpdatedAt()
- getIsActive()
- getCategoryId()
- getDisplayMode()
- getIncludeInMenu()
- getUrlKey()
- getChildrenData()
- __toArray()
- toFlatArray()
- setParentId()
- setName()
- setIsActive()
- setPosition()
- setLevel()
- setUpdatedAt()
- setCreatedAt()
- setPath()
- setAvailableSortBy()
- setIncludeInMenu()
- setProductCount()
- setChildrenData()
- getExtensionAttributes()
- setExtensionAttributes()