Log in
Model

Category

Magento\Catalog\Model\ResourceModel\Category

What it does

This is the core resource model for managing category data in Magento 2's database.

Developers use it to perform CRUD operations on categories, manage parent-child relationships, handle category-product associations, retrieve category trees, and update category paths.

It's essential when building custom category features, importing categories, or manipulating the category hierarchy programmatically.

Public Methods

  • getEntityType()
  • getCategoryProductTable()
  • setStoreId()
  • getStoreId()
  • deleteChildren()
  • getProductsPosition()
  • getChildrenCount()
  • checkId()
  • verifyIds()
  • getChildrenAmount()
  • getIsActiveAttributeId()
  • findWhereAttributeIs()
  • getProductCount()
  • getCategories()
  • getParentCategories()
  • getParentDesignCategory()
  • getChildrenCategories()
  • getChildren()
  • getAllChildren()
  • isInRootCategoryList()
  • isForbiddenToDelete()
  • getCategoryPathById()
  • changeParent()
  • countVisible()
  • load()
  • delete()
  • save()
  • getCategoryWithChildren()
  • _resetState()