Log in
Factory

StateDependentCollectionFactory

Magento\Catalog\Model\ResourceModel\Category\StateDependentCollectionFactory

What it does

This factory class creates the appropriate category collection based on whether the flat catalog index is enabled.

When flat indexing is available, it returns a Flat\Collection for better performance; otherwise, it returns the standard Collection.

Developers use this to automatically get the most efficient category collection without needing to check the flat index state manually.

Public Methods

  • create()