Log in
Collection

Store\Collection

Magento\Store\Model\ResourceModel\Store\Collection

What it does

This collection class is used to retrieve and manage multiple store records from the database in Magento 2.

Developers use it to fetch store data with various filters (by website, group, category, status), control whether to include the default admin store, and prepare store data for dropdowns and select options.

It's commonly used when building multi-store functionality or displaying store-related data in admin grids and forms.

Public Methods

  • setLoadDefault()
  • getLoadDefault()
  • setWithoutDefaultFilter()
  • addGroupFilter()
  • addStatusFilter()
  • addIdFilter()
  • addWebsiteFilter()
  • addCategoryFilter()
  • toOptionArray()
  • toOptionHash()
  • load()
  • loadByCategoryIds()
  • addRootCategoryIdAttribute()