Log in
Collection

AbstractCollection

Magento\Catalog\Model\ResourceModel\AbstractCollection

What it does

This abstract collection class provides a foundation for Magento 2 catalog collections (products, categories) that use flat tables instead of EAV structure.

Developers extend this class when building custom catalog collections, gaining methods to filter, sort, and paginate catalog entities with backward compatibility to EAV-style method calls.

It's commonly used as a base for product and category collections in flat table mode.

Public Methods

  • setSelectCountSql()
  • getSelectCountSql()
  • addAttributeToSelect()
  • addAttributeToFilter()
  • addAttributeToSort()
  • setPage()
  • getAllIds()
  • getSearchCriteria()
  • setSearchCriteria()
  • getTotalCount()
  • setTotalCount()
  • setItems()