Log in
Collection

AbstractCollection

Magento\Sales\Model\ResourceModel\Collection\AbstractCollection

What it does

This abstract base class provides a foundation for sales-related database collections in Magento 2 (orders, invoices, shipments, etc.).

It bridges EAV-style collection methods with flat table collections, offering backward compatibility while adding search criteria support for API operations.

Developers extend this class when creating custom sales entity collections that need both traditional collection filtering and API repository pattern support.

Public Methods

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