Log in
Factory

StateDependentCollectionFactory

Magento\Catalog\Model\ResourceModel\Category\StateDependentCollectionFactory

What it does

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

It automatically returns either a flat collection (optimized for performance) or a standard EAV collection depending on the system configuration.

Developers use this when they need a category collection that adapts to the current flat catalog state.

Public Methods

  • create()