Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Protected Member Functions
ProductCollection Class Reference
Inheritance diagram for ProductCollection:
Collection AbstractCollection AbstractCollection AbstractDb SourceProviderInterface Collection ArrayInterface CollectionDataSourceInterface OptionSourceInterface ArgumentInterface

Protected Member Functions

 _productLimitationJoinPrice ()
 
- Protected Member Functions inherited from Collection
 _preparePriceExpressionParameters ($select)
 
 _construct ()
 
 _init ($model, $entityModel)
 
 _initTables ()
 
 _prepareStaticFields ()
 
 _initSelect ()
 
 _afterLoad ()
 
 doAddWebsiteNamesToResult ()
 
 _getSelectCountSql (?Select $select=null, $resetLeftJoins=true)
 
 _prepareStatisticsData ()
 
 _getClearSelect ()
 
 _buildClearSelect ($select=null)
 
 _addUrlRewrite ()
 
 getEntityPkName (\Magento\Eav\Model\Entity\AbstractEntity $entity)
 
 _prepareProductLimitationFilters ()
 
 _productLimitationJoinWebsite ()
 
 _productLimitationJoinStore ()
 
 _productLimitationJoinPrice ()
 
 _productLimitationPrice ($joinLeft=false)
 
 _applyProductLimitations ()
 
 _applyZeroStoreProductLimitations ()
 
- Protected Member Functions inherited from AbstractCollection
 getEntityPkName (\Magento\Eav\Model\Entity\AbstractEntity $entity)
 
 _getLoadAttributesSelect ($table, $attributeIds=[])
 
 _addLoadAttributesSelectValues ($select, $table, $type)
 
 _joinAttributeToSelect ($method, $attribute, $tableAlias, $condition, $fieldCode, $fieldAlias)
 
- Protected Member Functions inherited from AbstractCollection
 _construct ()
 
 _prepareStaticFields ()
 
 _initSelect ()
 
 _init ($model, $entityModel)
 
 _prepareOrderExpression ($field)
 
 _getAllIdsSelect ($limit=null, $offset=null)
 
 _getLoadAttributesSelect ($table, $attributeIds=[])
 
 _addLoadAttributesSelectValues ($select, $table, $type)
 
 _setItemAttributeValue ($valueInfo)
 
 _getAttributeTableAlias ($attributeCode)
 
 _getAttributeFieldName ($attributeCode)
 
 _addAttributeJoin ($attributeCode, $joinType='inner')
 
 getEntityPkName (\Magento\Eav\Model\Entity\AbstractEntity $entity)
 
 _joinAttributeToSelect ($method, $attribute, $tableAlias, $condition, $fieldCode, $fieldAlias)
 
 _getAttributeConditionSql ($attribute, $condition, $joinType='inner')
 
 _renderOrders ()
 
 _afterLoad ()
 
 _reset ()
 
- Protected Member Functions inherited from AbstractDb
 _setIdFieldName ($fieldName)
 
 _getItemId (\Magento\Framework\DataObject $item)
 
 _renderFilters ()
 
 _renderFiltersBefore ()
 
 _translateCondition ($field, $condition)
 
 _getMappedField ($field)
 
 _getMapper ()
 
 _getConditionSql ($fieldName, $condition)
 
 _getConditionFieldName ($fieldName)
 
 _renderOrders ()
 
 _renderLimit ()
 
 _beforeLoad ()
 
 beforeAddLoadedItem (\Magento\Framework\DataObject $item)
 
 _toOptionArray ($valueField=null, $labelField='name', $additional=[])
 
 _toOptionHash ($valueField=null, $labelField='name')
 
 _afterLoadData ()
 
 _afterLoad ()
 
 _logQuery ($sql)
 
 _reset ()
 
 _fetchAll (Select $select)
 
 _initSelect ()
 
- Protected Member Functions inherited from Collection
 _setIsLoaded ($flag=true)
 
 _addItem ($item)
 
 _getItemId (\Magento\Framework\DataObject $item)
 
 _renderFilters ()
 
 _renderOrders ()
 
 _renderLimit ()
 
 _toOptionArray ($valueField='id', $labelField='name', $additional=[])
 
 _toOptionHash ($valueField='id', $labelField='name')
 

Additional Inherited Members

- Public Member Functions inherited from Collection
 __construct (\Magento\Framework\Data\Collection\EntityFactory $entityFactory, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\App\ResourceConnection $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Module\Manager $moduleManager, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\ResourceModel\Url $catalogUrl, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Customer\Model\Session $customerSession, \Magento\Framework\Stdlib\DateTime $dateTime, GroupManagementInterface $groupManagement, \Magento\Framework\DB\Adapter\AdapterInterface $connection=null, ProductLimitationFactory $productLimitationFactory=null, MetadataPool $metadataPool=null, TableMaintainer $tableMaintainer=null, PriceTableResolver $priceTableResolver=null, DimensionFactory $dimensionFactory=null)
 
 getCatalogPreparedSelect ()
 
 getPriceExpression ($select)
 
 getAdditionalPriceExpression ($select)
 
 getCurrencyRate ()
 
 getFlatState ()
 
 isEnabledFlat ()
 
 getNewEmptyItem ()
 
 setEntity ($entity)
 
 setStore ($store)
 
 _loadAttributes ($printQuery=false, $logQuery=false)
 
 addAttributeToSelect ($attribute, $joinType=false)
 
 addIdFilter ($productId, $exclude=false)
 
 addWebsiteNamesToResult ()
 
 load ($printQuery=false, $logQuery=false)
 
 addStoreFilter ($store=null)
 
 addWebsiteFilter ($websites=null)
 
 getLimitationFilters ()
 
 addCategoryFilter (\Magento\Catalog\Model\Category $category)
 
 addCategoriesFilter (array $categoriesFilter)
 
 joinMinimalPrice ()
 
 getMaxAttributeValue ($attribute)
 
 getAttributeValueCountByRange ($attribute, $range)
 
 getAttributeValueCount ($attribute)
 
 getSelectCountSql ()
 
 getAllIds ($limit=null, $offset=null)
 
 getProductCountSelect ()
 
 unsProductCountSelect ()
 
 addCountToCategories ($categoryCollection)
 
 joinUrlRewrite ()
 
 addUrlRewrite ($categoryId='')
 
 addMinimalPrice ()
 
 addFinalPrice ()
 
 getAllIdsCache ($resetCache=false)
 
 setAllIdsCache ($value)
 
 addPriceData ($customerGroupId=null, $websiteId=null)
 
 addAttributeToFilter ($attribute, $condition=null, $joinType='inner')
 
 addTaxPercents ()
 
 requireTaxPercent ()
 
 addOptionsToResult ()
 
 addFilterByRequiredOptions ()
 
 setVisibility ($visibility)
 
 addAttributeToSort ($attribute, $dir=self::SORT_ORDER_ASC)
 
 applyFrontendPriceLimitations ()
 
 addCategoryIds ()
 
 addTierPriceData ()
 
 addTierPriceDataByGroupId ($customerGroupId)
 
 addPriceDataFieldFilter ($comparisonFormat, $fields)
 
 addMediaGalleryData ()
 
 getProductEntityMetadata ()
 
 clear ()
 
 setOrder ($attribute, $dir=Select::SQL_DESC)
 
 getMaxPrice ()
 
 getMinPrice ()
 
 getPriceStandardDeviation ()
 
 getPricesCount ()
 
- Public Member Functions inherited from AbstractCollection
 __construct (\Magento\Framework\Data\Collection\EntityFactory $entityFactory, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\App\ResourceConnection $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Eav\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\DB\Adapter\AdapterInterface $connection=null)
 
 setStore ($store)
 
 setStoreId ($storeId)
 
 getStoreId ()
 
 getDefaultStoreId ()
 
- Public Member Functions inherited from AbstractCollection
 __construct (\Magento\Framework\Data\Collection\EntityFactory $entityFactory, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\App\ResourceConnection $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Eav\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, \Magento\Framework\DB\Adapter\AdapterInterface $connection=null)
 
 getTable ($table)
 
 setEntity ($entity)
 
 getEntity ()
 
 getResource ()
 
 setObject ($object=null)
 
 addItem (\Magento\Framework\DataObject $object)
 
 getAttribute ($attributeCode)
 
 addAttributeToFilter ($attribute, $condition=null, $joinType='inner')
 
 addFieldToFilter ($attribute, $condition=null)
 
 addAttributeToSort ($attribute, $dir=self::SORT_ORDER_ASC)
 
 addAttributeToSelect ($attribute, $joinType=false)
 
 addEntityTypeToSelect ($entityType, $prefix)
 
 addStaticField ($field)
 
 addExpressionAttributeToSelect ($alias, $expression, $attribute)
 
 groupByAttribute ($attribute)
 
 joinAttribute ($alias, $attribute, $bind, $filter=null, $joinType='inner', $storeId=null)
 
 joinField ($alias, $table, $field, $bind, $cond=null, $joinType='inner')
 
 joinTable ($table, $bind, $fields=null, $cond=null, $joinType='inner')
 
 removeAttributeToSelect ($attribute=null)
 
 setPage ($pageNum, $pageSize)
 
 load ($printQuery=false, $logQuery=false)
 
 getAllIds ($limit=null, $offset=null)
 
 getAllIdsSql ()
 
 save ()
 
 delete ()
 
 importFromArray ($arr)
 
 exportToArray ()
 
 getRowIdFieldName ()
 
 getIdFieldName ()
 
 setRowIdFieldName ($fieldName)
 
 _loadAttributes ($printQuery=false, $logQuery=false)
 
 setOrder ($attribute, $dir=self::SORT_ORDER_ASC)
 
 toArray ($arrAttributes=[])
 
 isAttributeAdded ($attributeCode)
 
 getLoadedIds ()
 
 clear ()
 
 removeAllItems ()
 
 removeItemByKey ($key)
 
 getMainTable ()
 
 addFieldToSelect ($field, $alias=null)
 
 removeFieldFromSelect ($field)
 
 removeAllFieldsFromSelect ()
 
- Public Member Functions inherited from AbstractDb
 __construct (EntityFactoryInterface $entityFactory, Logger $logger, FetchStrategyInterface $fetchStrategy, \Magento\Framework\DB\Adapter\AdapterInterface $connection=null)
 
 getResource ()
 
 addBindParam ($name, $value)
 
 getIdFieldName ()
 
 setConnection (\Magento\Framework\DB\Adapter\AdapterInterface $conn)
 
 getSelect ()
 
 getConnection ()
 
 getSize ()
 
 getSelectCountSql ()
 
 getSelectSql ($stringMode=false)
 
 setOrder ($field, $direction=self::SORT_ORDER_DESC)
 
 addOrder ($field, $direction=self::SORT_ORDER_DESC)
 
 unshiftOrder ($field, $direction=self::SORT_ORDER_DESC)
 
 addFieldToFilter ($field, $condition=null)
 
 distinct ($flag)
 
 load ($printQuery=false, $logQuery=false)
 
 loadWithFilter ($printQuery=false, $logQuery=false)
 
 fetchItem ()
 
 getData ()
 
 resetData ()
 
 loadData ($printQuery=false, $logQuery=false)
 
 printLogQuery ($printQuery=false, $logQuery=false, $sql=null)
 
 addFilterToMap ($filter, $alias, $group='fields')
 
 __clone ()
 
 joinExtensionAttribute (JoinDataInterface $join, JoinProcessorInterface $extensionAttributesJoinProcessor)
 
 getItemObjectClass ()
 
 __sleep ()
 
 __wakeup ()
 
- Public Member Functions inherited from Collection
 __construct (EntityFactoryInterface $entityFactory)
 
 addFilter ($field, $value, $type='and')
 
 addFieldToFilter ($field, $condition)
 
 getFilter ($field)
 
 isLoaded ()
 
 getCurPage ($displacement=0)
 
 getLastPageNumber ()
 
 getPageSize ()
 
 getSize ()
 
 getFirstItem ()
 
 getLastItem ()
 
 getItems ()
 
 getColumnValues ($colName)
 
 getItemsByColumnValue ($column, $value)
 
 getItemByColumnValue ($column, $value)
 
 addItem (\Magento\Framework\DataObject $item)
 
 getAllIds ()
 
 removeItemByKey ($key)
 
 removeAllItems ()
 
 clear ()
 
 walk ($callback, array $args=[])
 
 each ($objMethod, $args=[])
 
 setDataToAll ($key, $value=null)
 
 setCurPage ($page)
 
 setPageSize ($size)
 
 setOrder ($field, $direction=self::SORT_ORDER_DESC)
 
 setItemObjectClass ($className)
 
 getNewEmptyItem ()
 
 distinct ($flag)
 
 loadData ($printQuery=false, $logQuery=false)
 
 load ($printQuery=false, $logQuery=false)
 
 loadWithFilter ($printQuery=false, $logQuery=false)
 
 toXml ()
 
 toArray ($arrRequiredFields=[])
 
 toOptionArray ()
 
 toOptionHash ()
 
 getItemById ($idValue)
 
 getIterator ()
 
 count ()
 
 getFlag ($flag)
 
 setFlag ($flag, $value=null)
 
 hasFlag ($flag)
 
 __sleep ()
 
 __wakeup ()
 
- Public Member Functions inherited from SourceProviderInterface
 getSelect ()
 
- Data Fields inherited from Collection
const INDEX_TABLE_ALIAS = 'price_index'
 
const MAIN_TABLE_ALIAS = 'e'
 
- Data Fields inherited from AbstractCollection
const ATTRIBUTE_TABLE_ALIAS_PREFIX = 'at_'
 
- Data Fields inherited from Collection
const SORT_ORDER_ASC = 'ASC'
 
const SORT_ORDER_DESC = 'DESC'
 
- Protected Attributes inherited from Collection
 $_idFieldName = 'entity_id'
 
 $_flatEnabled = []
 
 $_productWebsiteTable
 
 $_productCategoryTable
 
 $_addUrlRewrite = false
 
 $_urlRewriteCategory = ''
 
 $_addFinalPrice = false
 
 $_allIdsCache = null
 
 $_addTaxPercents = false
 
 $_productLimitationFilters
 
 $_productCountSelect = null
 
 $_isWebsiteFilter = false
 
 $_priceDataFieldFilters = []
 
 $_priceExpression
 
 $_additionalPriceExpression
 
 $_maxPrice
 
 $_minPrice
 
 $_priceStandardDeviation
 
 $_pricesCount = null
 
 $_catalogPreparePriceSelect = null
 
 $_catalogProductFlatState = null
 
 $moduleManager = null
 
 $_scopeConfig
 
 $_customerSession
 
 $_localeDate
 
 $_catalogUrl
 
 $_productOptionFactory
 
 $_resourceHelper
 
 $dateTime
 
 $_groupManagement
 
 $needToAddWebsiteNamesToResult
 
- Protected Attributes inherited from AbstractCollection
 $_storeId
 
 $_storeManager
 
- Protected Attributes inherited from AbstractCollection
 $_itemsById = []
 
 $_staticFields = []
 
 $_entity
 
 $_selectEntityTypes = []
 
 $_selectAttributes = []
 
 $_filterAttributes = []
 
 $_joinEntities = []
 
 $_joinAttributes = []
 
 $_joinFields = []
 
 $_castToIntMap = ['validate-digits']
 
 $_eventManager = null
 
 $_eavConfig
 
 $_resource
 
 $_eavEntityFactory
 
 $_resourceHelper
 
 $_universalFactory
 
- Protected Attributes inherited from AbstractDb
 $_conn
 
 $_select
 
 $_idFieldName
 
 $_bindParams = []
 
 $_data = null
 
 $_map = null
 
 $_fetchStmt = null
 
 $_isOrdersRendered = false
 
 $_logger
 
 $extensionAttributesJoinProcessor
 
- Protected Attributes inherited from Collection
 $_items = []
 
 $_itemObjectClass = \Magento\Framework\DataObject::class
 
 $_orders = []
 
 $_filters = []
 
 $_isFiltersRendered = false
 
 $_curPage = 1
 
 $_pageSize = false
 
 $_totalRecords
 
 $_isCollectionLoaded
 
 $_flags = []
 
 $_entityFactory
 

Detailed Description

Collection which is used for rendering product list in the backend.

Used for product grid and customizes behavior of the default Product collection for grid needs.

Definition at line 13 of file ProductCollection.php.

Member Function Documentation

◆ _productLimitationJoinPrice()

_productLimitationJoinPrice ( )
protected

Disables using of price index for grid rendering

Admin area shouldn't use price index and should rely on actual product data instead.

@codeCoverageIgnore

Returns
\Magento\Catalog\Model\ResourceModel\Product\Collection

Definition at line 23 of file ProductCollection.php.

24  {
25  $this->_productLimitationFilters->setUsePriceIndex(false);
26  return $this->_productLimitationPrice(true);
27  }

The documentation for this class was generated from the following file: