Log in
Model

Flat

Magento\Catalog\Model\ResourceModel\Category\Flat

What it does

This resource model manages Magento 2's flat category table, which is an optimized denormalized version of category data for faster frontend performance.

Developers use this class to retrieve category hierarchies, check category relationships, get product counts per category, and query category data when the flat catalog is enabled.

It provides methods for building category trees, getting parent/child relationships, and filtering active categories for navigation menus.

Public Methods

  • setStoreId()
  • getStoreId()
  • getMainTable()
  • getMainStoreTable()
  • addInactiveCategoryIds()
  • getInactiveCategoryIds()
  • addChildNodes()
  • getNodes()
  • getCategories()
  • getNodeById()
  • getAttribute()
  • getChildrenAmount()
  • getProductCount()
  • getParentCategories()
  • getParentDesignCategory()
  • getChildrenCategories()
  • isInRootCategoryList()
  • getChildren()
  • getAllChildren()
  • checkId()
  • getAnchorsAbove()
  • getProductsPosition()