Log in
Collection

AbstractCollection

Magento\Sales\Model\ResourceModel\Collection\AbstractCollection

What it does

This abstract collection class serves as the foundation for all sales-related collections in Magento 2 (orders, invoices, shipments, etc.).

It provides backward compatibility with EAV collections by offering methods like addAttributeToSelect, addAttributeToFilter, and addAttributeToSort, while working with flat database tables.

Developers extend this class when creating custom sales entity collections or repositories.

Public Methods

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