Documentation

Mage_Catalog_Model_Resource_Product_Link_Product_Collection extends Mage_Catalog_Model_Resource_Product_Collection
in package

Catalog EAV collection resource abstract model Implement using different stores for retrieve attribute values

Table of Contents

Constants

INDEX_TABLE_ALIAS  : mixed = 'price_index'
Alias for index table
MAIN_TABLE_ALIAS  : mixed = 'e'
Alias for main table
SORT_ORDER_ASC  : mixed = 'ASC'
SORT_ORDER_DESC  : mixed = 'DESC'

Properties

$_addFinalPrice  : bool
Is add final price to product collection flag
$_additionalPriceExpression  : string|null
Additional price expression sql part
$_addMinimalPrice  : bool
Is add minimal price to product collection flag
$_addTaxPercents  : bool
Is add tax percents to product collection flag
$_addUrlRewrite  : bool
Is add URL rewrites to collection flag
$_allIdsCache  : array<string|int, mixed>|null
Cache for all ids
$_bindParams  : array<string|int, mixed>
List of binded variables for select
$_cacheConf  : array<string|int, mixed>
Cache configuration array
$_cacheKey  : mixed
$_cacheLifetime  : mixed
$_cacheTags  : mixed
$_castToIntMap  : array<string|int, mixed>
Cast map for attribute order
$_catalogPreparePriceSelect  : Select
Cloned Select after dispatching 'catalog_prepare_price_select' event
$_conn  : AdapterInterface
DB connection
$_curPage  : int|null
Current page number for items pager
$_data  : array<string|int, mixed>|null
All collection data array Used for getData method
$_entity  : Mage_Eav_Model_Entity_Abstract|null
Entity object to define collection's attributes
$_factory  : Mage_Catalog_Model_Factory
Catalog factory instance
$_fetchStmt  : StatementInterface|null
Database's statement for fetch item one by one
$_filterAttributes  : array<string|int, mixed>
Attributes to be filtered order sorted by
$_filters  : array<string|int, mixed>
Filters configuration
$_flags  : array<string|int, mixed>
Additional collection flags
$_hasLinkFilter  : bool
Store flag that determine if product filter was enabled
$_idFieldName  : string
Identifier fild name for collection items
$_isCollectionLoaded  : bool
Loading state flag
$_isFiltersRendered  : bool
Filter rendered flag
$_isOrdersRendered  : bool
Whether orders are rendered
$_isStrongMode  : bool
Store strong mode flag that determine if needed for inner join or left join of linked products
$_isWebsiteFilter  : bool
$_itemObjectClass  : string
Item object class name
$_items  : array<string|int, mixed>
Collection items
$_itemsById  : array<string|int, mixed>
Array of items with item id key
$_joinAttributes  : array<string|int, mixed>
Joined attributes
$_joinEntities  : array<string|int, mixed>
Joined entities
$_joinFields  : array<string|int, mixed>
Joined fields data
$_linkModel  : Mage_Catalog_Model_Product_Link
Store product link model
$_linkTypeId  : int
Store link type id
$_map  : array<string|int, mixed>|null
Map of price fields
$_maxPrice  : float|null
Max prise (statistics data)
$_minPrice  : float|null
Min prise (statistics data)
$_orders  : array<string|int, mixed>
Order configuration
$_pageSize  : int|false|null
Pager page size
$_priceDataFieldFilters  : array<string|int, mixed>
Additional field filters, applied in _productLimitationJoinPrice()
$_priceExpression  : string|null
Price expression sql
$_pricesCount  : int|null
Prises count (statistics data)
$_priceStandardDeviation  : float|null
Prise standard deviation (statistics data)
$_product  : Mage_Catalog_Model_Product
Store product model
$_productCategoryTable  : string
Product categories table name
$_productCountSelect  : Select|null
Category product count select
$_productLimitationFilters  : array<string|int, mixed>
Product limitation filters Allowed filters store_id int; category_id int; category_is_anchor int; visibility array|int; website_ids array|int; store_table string; use_price_index bool; join price index table flag customer_group_id int; required for price; customer group limitation for price website_id int; required for price; website limitation for price
$_productWebsiteTable  : string
Product websites table name
$_select  : Select
Select oblect
$_selectAttributes  : array<string|int, mixed>
Attributes to be fetched for objects in collection
$_selectEntityTypes  : array<string|int, mixed>
Entity types to be fetched for objects in collection
$_staticFields  : array<string|int, mixed>
Entity static fields
$_storeId  : int|null
Current scope (store Id)
$_totalRecords  : int|null
Total items number
$_urlRewriteCategory  : int|string
Add URL rewrite for category
$_useAnalyticFunction  : bool
Use analytic function flag If true - allows to prepare final select with analytic functions

Methods

__clone()  : void
Magic clone function
__construct()  : mixed
Initialize factory
_loadAttributes()  : $this
Load attributes into loaded entities
_loadEntities()  : $this
Load entities records into items
_prepareSelect()  : string
Prepare select for load
addAttributeToFilter()  : $this
Add attribute filter to collection
addAttributeToSelect()  : $this
Add attribute to entities in collection
addAttributeToSort()  : $this
Add attribute to sort order
addBindParam()  : $this
Add variable to bind list
addCategoryFilter()  : $this
Specify category filter for product collection
addCategoryIds()  : $this
Add category ids to loaded items
addCountToCategories()  : $this
Adding product count to categories collection
addEntityTypeToSelect()  : $this
addExcludeProductFilter()  : $this
Exclude products from filter
addExpressionAttributeToSelect()  : $this
Add attribute expression (SUM, COUNT, etc)
addFieldToFilter()  : $this
Wrapper for compatibility with \Maho\Data\Collection\Db
addFilter()  : $this
Add collection filter
addFilterByRequiredOptions()  : $this
Filter products with required options
addFilterToMap()  : $this
Add filter to Map
addIdFilter()  : $this
Add collection filters by identifiers
addItem()  : $this
Skip duplicate items when DISTINCT deduplication is active, which can happen when multiple parent products link to the same target (e.g. cart cross-sells)
addLinkModelFieldToFilter()  : $this
Add specific link model attribute to collection filter
addOptionsToResult()  : $this
Adding product custom options to result collection
addOrder()  : $this
self::setOrder() alias
addPriceData()  : $this
Add Price Data to result
addPriceDataFieldFilter()  : $this
Add field comparison expression
addProductFilter()  : $this
Add products to filter
addStaticField()  : $this
Add field to static
addStoreFilter()  : $this
Add store availability filter. Include availability product for store website
addTaxPercents()  : $this
Add requere tax percent flag for product collection
addTierPriceData()  : $this
Add tier price data to loaded items
addUrlRewrite()  : $this
Add URL rewrites data to product If collection loadded - run processing else set flag
addWebsiteFilter()  : $this
Add website filter to collection
addWebsiteNamesToResult()  : $this
Adding product website names to result collection Add for each product websites information
applyFrontendPriceLimitations()  : $this
Apply front-end price limitation filters to the collection
clear()  : $this
Clear collection
count()  : int
Retrieve count of collection loaded items
delete()  : mixed
Delete all the entities in the collection
distinct()  : $this
Set select distinct
each()  : void
exportToArray()  : array<string|int, mixed>
Get collection data as a 2D array
fetchItem()  : DataObject|bool
Returns a collection item that corresponds to the fetched row and moves the internal data pointer ahead
getAdditionalPriceExpression()  : string
Get additional price expression sql part
getAllAttributeValues()  : array<string|int, mixed>
Return all attribute values as array in form: [ [entity_id_1] => [ [store_id_1] => store_value_1, [store_id_2] => store_value_2, ... [store_id_n] => store_value_n ], ... ]
getAllIds()  : array<string|int, mixed>
Retrieve all ids for collection
getAllIdsCache()  : array<string|int, mixed>
Retrieve all ids
getAttribute()  : Mage_Eav_Model_Entity_Attribute_Abstract
Retrieve entity attribute
getAttributeValueCount()  : array<string|int, mixed>
Retrieve product count by some value of attribute
getAttributeValueCountByRange()  : array<string|int, mixed>
Retrieve ranging product count for attribute range
getCacheKey()  : string
getCacheLifetime()  : int
getCacheTags()  : array<string|int, mixed>
getCatalogPreparedSelect()  : Select|null
Get cloned Select after dispatching 'catalog_prepare_price_select' event
getColumnValues()  : array<string|int, mixed>
Retrieve field values from all items
getConnection()  : AdapterInterface
Retrieve connection object
getCurPage()  : int
Get current collection page
getCurrencyRate()  : float
Get currency rate
getData()  : array<string|int, mixed>
Get all data array for collection
getDefaultStoreId()  : int
Retrieve default store id
getEntity()  : Mage_Eav_Model_Entity_Abstract
Get collection's entity object
getFilter()  : DataObject|array<string|int, mixed>|null
Search for a filter by specified field
getFirstItem()  : DataObject
Retrieve collection first item
getFlag()  : mixed
Retrieve Flag
getIdFieldName()  : string
Id field name getter
getItemByColumnValue()  : DataObject|null
Search first item by field value
getItemById()  : Mage_Catalog_Model_Product
Retrieve item by id
getItems()  : array<string|int, Mage_Catalog_Model_Product>
Retrieve collection items
getItemsByColumnValue()  : array<string|int, mixed>
Search all items by field value
getIterator()  : mixed
Implementation of IteratorAggregate::getIterator()
getLastItem()  : DataObject
Retrieve collection last item
getLastPageNumber()  : int
Retrieve collection last page number
getLimitationFilters()  : array<string|int, mixed>
Get filters applied to collection
getLinkModel()  : Mage_Catalog_Model_Product_Link
Retrieve collection link model
getLoadedIds()  : mixed
Returns already loaded element ids
getMaxAttributeValue()  : mixed
Retrieve max value by attribute
getMaxPrice()  : float
Get products max price
getMinPrice()  : float
Get products min price
getNewEmptyItem()  : DataObject
Retrieve collection empty item
getPageSize()  : int
Retrieve collection page size
getPriceExpression()  : string
Get price expression sql part
getPricesCount()  : int
Get count of product prices
getPriceStandardDeviation()  : float
Get standard deviation of products price
getProduct()  : Mage_Catalog_Model_Product
Retrieve collection base product object
getProductCountSelect()  : Select
Retrieve product count select for categories
getProductTypeIds()  : array<string|int, mixed>
Return array of unique product type ids in collection
getResource()  : Mage_Eav_Model_Entity_Abstract
Get resource instance
getRowIdFieldName()  : string
Retrieve row id field name
getSelect()  : Select
Get Select instance
getSelectCountSql()  : Select
Get SQL for get record count without left JOINs
getSelectSql()  : string|Select
Get sql select string or object
getSetIds()  : array<string|int, mixed>
Retrieve unique attribute set ids in collection
getSize()  : int
Get collection size
getStoreId()  : int
Return current store id
getTable()  : string
Retrieve table name
groupByAttribute()  : $this
Groups results by specified attribute
hasFlag()  : bool
Has Flag
importFromArray()  : $this
Import 2D array into collection as objects
initCache()  : $this
Initialize collection cache
isLoaded()  : bool
Retrieve collection loading status
isModuleEnabled()  : bool
joinAttribute()  : $this
Add attribute from joined entity to select
joinAttributes()  : $this
Join attributes
joinField()  : $this
Join regular table field and use an attribute as fk
joinMinimalPrice()  : $this
Join minimal price attribute to result
joinTable()  : $this
Join a table
load()  : $this
Load collection data into object items
loadData()  : $this
Load data
printLogQuery()  : $this
Print and/or log query
removeAttributeToSelect()  : $this
Remove an attribute from selection list
removeItemByKey()  : $this
Remove item from collection by item key
requireTaxPercent()  : bool
Get require tax percent flag value
resetData()  : $this
Reset loaded for collection data array
save()  : mixed
Save all the entities in the collection
setAllIdsCache()  : $this
Set all ids
setAttributeSetIdOrder()  : $this
Enable sorting products by its attribute set name
setCacheKey()  : $this
setCacheTags()  : $this
setConnection()  : $this
Set database connection adapter
setCurPage()  : $this
Set current page
setDataToAll()  : $this
Setting data for all collection items
setEntity()  : $this
Set entity to use for attributes
setFlag()  : $this
Set Flag
setGroupBy()  : $this
Setting distinct to exclude duplications in collection
setIsStrongMode()  : $this
Enable strong mode for inner join of linked products
setItemObjectClass()  : $this
Set collection item class name
setLinkModel()  : $this
Declare link model and initialize type attributes join
setObject()  : $this
Set template object for the collection
setOrder()  : $this
Set sorting order
setPage()  : $this
Set collection page start and records to show
setPageSize()  : $this
Set collection page size
setPositionOrder()  : $this
Enable sorting products by its position
setProduct()  : $this
Initialize collection parent product and add limitation join
setRandomOrder()  : $this
Add random sorting order
setRowIdFieldName()  : $this
Set row id field name
setStore()  : $this
Set store scope
setStoreId()  : $this
Set store scope
setVisibility()  : $this
Set product visibility filter for enabled products
toArray()  : array<string|int, mixed>
Retrieve array of attributes
toOptionArray()  : array<string|int, mixed>
toOptionHash()  : array<string|int, mixed>
toXml()  : string
Convert collection to XML
unshiftOrder()  : $this
Add select order to the beginning
unsProductCountSelect()  : $this
Destruct product count select
walk()  : array<string|int, mixed>
Walk through the collection and run model method or external callback with optional arguments
_addAttributeJoin()  : $this
Add attribute value table to the join if it wasn't added previously
_addFinalPrice()  : $this
Add final price to the product
_addItem()  : $this
Add item that has no id to collection
_addLoadAttributesSelectValues()  : Select
_addUrlRewrite()  : mixed
Add URL rewrites to collection
_afterLoad()  : $this
Processing collection items after loading Adding url rewrites, minimal prices, final prices, tax percents
_afterLoadData()  : $this
Process loaded collection data
_applyProductLimitations()  : $this
Apply limitation filters to collection Method allows using one time category product index table (or product website table) for different combinations of store_id/category_id/visibility filter states Method supports multiple changes in one collection object for this parameters
_applyZeroStoreProductLimitations()  : $this
Apply limitation filters to collection base on API Method allows using one time category product table for combinations of category_id filter states
_beforeLoad()  : $this
Join linked products when specified link model
_buildClearSelect()  : Select
Build clear select
_canUseCache()  : Mage_Core_Model_Cache|false
Check if cache can be used for collection data
_construct()  : mixed
Initialize collection
_fetchAll()  : array<string|int, mixed>
Fetch collection data
_getAllIdsSelect()  : Select
Clone and reset collection
_getAttributeCodeByValueInfo()  : string
_getAttributeConditionSql()  : string
Get condition sql for the attribute
_getAttributeFieldName()  : string
Retrieve attribute field name by attribute code
_getAttributeTableAlias()  : string
Get alias for attribute value table
_getCacheTags()  : array<string|int, mixed>
Get cache tags list
_getClearSelect()  : Select
Retrieve clear select
_getConditionFieldName()  : string
_getConditionSql()  : string
Build SQL statement for condition
_getItemId()  : mixed
Get collection item identifier
_getLinkAttributeTableAlias()  : string
Get table alias for link model attribute
_getLoadAttributesSelect()  : Select
Retrieve attributes load select
_getMappedField()  : string
Try to get mapped field name for filter to collection
_getMapper()  : array<string|int, mixed>|bool|null
Retrieve mapper data
_getSelectCacheId()  : string
Get cache identifier base on select
_getSelectCountSql()  : Select
Get SQL for get record count
_init()  : $this
Standard resource collection initialization
_initSelect()  : $this
Initialize collection select Redeclared for remove entity_type_id condition in catalog_product_entity we store just products
_initTables()  : mixed
Define product website and category product tables
_joinAttributeToSelect()  : Mage_Eav_Model_Entity_Collection_Abstract
Adding join statement to collection select instance
_joinLinks()  : $this
Join linked products and their attributes
_joinPriceRules()  : $this
Join prices from price rules to products collection
_loadCache()  : string|false
Load cached data for select
_prepareOrderExpression()  : string|Expr
Retrieve attribute expression by specified column
_preparePriceExpressionParameters()  : $this
Prepare additional price expression sql part
_prepareProductLimitationFilters()  : $this
Prepare limitation filters
_prepareStaticFields()  : $this
Prepare static entity fields
_prepareStatisticsData()  : $this
Prepare statistics data
_productLimitationJoinPrice()  : $this
Join Product Price Table
_productLimitationJoinStore()  : $this
Join additional (alternative) store visibility filter
_productLimitationJoinWebsite()  : $this
Join website product limitation
_productLimitationPrice()  : $this
Join Product Price Table with left-join possibility
_renderFilters()  : $this
Render sql select conditions
_renderFiltersBefore()  : mixed
Hook for operations before rendering filters
_renderLimit()  : $this
Render sql select limit
_renderOrders()  : $this
Treat "order by" items as attributes to sort
_reset()  : $this
Reset collection
_saveCache()  : $this
Save collection data to cache
_setIdFieldName()  : $this
Specify collection objects id field name
_setIsLoaded()  : $this
Set collection loading status flag
_setItemAttributeValue()  : $this
Initialize entity object property value
_setPriceScopeOnItems()  : void
A product carries no store of its own, so a price read outside a storefront would resolve the rate against whatever store is current.
_toOptionArray()  : array<string|int, mixed>
Convert items array to array for select options
_toOptionHash()  : array<string|int, mixed>
Convert items array to hash for select options
_toOptionHashOptimized()  : array<string|int, mixed>
Convert items array to hash for select options unsing fetchItem method
_translateCondition()  : string
Build sql where condition part
getCache()  : Mage_Core_Model_Cache|null

Constants

INDEX_TABLE_ALIAS

Alias for index table

public mixed INDEX_TABLE_ALIAS = 'price_index'

MAIN_TABLE_ALIAS

Alias for main table

public mixed MAIN_TABLE_ALIAS = 'e'

SORT_ORDER_ASC

public mixed SORT_ORDER_ASC = 'ASC'

SORT_ORDER_DESC

public mixed SORT_ORDER_DESC = 'DESC'

Properties

$_addFinalPrice

Is add final price to product collection flag

protected bool $_addFinalPrice = \false

$_additionalPriceExpression

Additional price expression sql part

protected string|null $_additionalPriceExpression

$_addMinimalPrice

Is add minimal price to product collection flag

protected bool $_addMinimalPrice = \false

$_addTaxPercents

Is add tax percents to product collection flag

protected bool $_addTaxPercents = \false

$_addUrlRewrite

Is add URL rewrites to collection flag

protected bool $_addUrlRewrite = \false

$_allIdsCache

Cache for all ids

protected array<string|int, mixed>|null $_allIdsCache = \null

$_bindParams

List of binded variables for select

protected array<string|int, mixed> $_bindParams = []

$_cacheConf

Cache configuration array

protected array<string|int, mixed> $_cacheConf = null

$_cacheLifetime

protected mixed $_cacheLifetime = 86400

$_castToIntMap

Cast map for attribute order

protected array<string|int, mixed> $_castToIntMap = ['validate-digits']

$_catalogPreparePriceSelect

Cloned Select after dispatching 'catalog_prepare_price_select' event

protected Select $_catalogPreparePriceSelect = \null

$_curPage

Current page number for items pager

protected int|null $_curPage = 1

$_data

All collection data array Used for getData method

protected array<string|int, mixed>|null $_data = null

$_fetchStmt

Database's statement for fetch item one by one

protected StatementInterface|null $_fetchStmt = null

$_filterAttributes

Attributes to be filtered order sorted by

protected array<string|int, mixed> $_filterAttributes = []

$_filters

Filters configuration

protected array<string|int, mixed> $_filters = []

$_flags

Additional collection flags

protected array<string|int, mixed> $_flags = []

$_hasLinkFilter

Store flag that determine if product filter was enabled

protected bool $_hasLinkFilter = \false

$_idFieldName

Identifier fild name for collection items

protected string $_idFieldName

Can be used by collections with items without defined

$_isCollectionLoaded

Loading state flag

protected bool $_isCollectionLoaded

$_isFiltersRendered

Filter rendered flag

protected bool $_isFiltersRendered = false

$_isOrdersRendered

Whether orders are rendered

protected bool $_isOrdersRendered = false

$_isStrongMode

Store strong mode flag that determine if needed for inner join or left join of linked products

protected bool $_isStrongMode

$_isWebsiteFilter

protected bool $_isWebsiteFilter = \false

$_itemObjectClass

Item object class name

protected string $_itemObjectClass = \Maho\DataObject::class

$_items

Collection items

protected array<string|int, mixed> $_items = []

$_itemsById

Array of items with item id key

protected array<string|int, mixed> $_itemsById = []

$_joinAttributes

Joined attributes

protected array<string|int, mixed> $_joinAttributes = []

$_joinEntities

Joined entities

protected array<string|int, mixed> $_joinEntities = []

$_joinFields

Joined fields data

protected array<string|int, mixed> $_joinFields = []

$_linkTypeId

Store link type id

protected int $_linkTypeId

$_map

Map of price fields

protected array<string|int, mixed>|null $_map = ['fields' => ['price' => 'price_index.price', 'final_price' => 'price_index.final_price', 'min_price' => 'price_index.min_price', 'max_price' => 'price_index.max_price', 'tier_price' => 'price_index.tier_price', 'special_price' => 'price_index.special_price']]
Attributes
#[Override]

$_maxPrice

Max prise (statistics data)

protected float|null $_maxPrice

$_minPrice

Min prise (statistics data)

protected float|null $_minPrice

$_orders

Order configuration

protected array<string|int, mixed> $_orders = []

$_pageSize

Pager page size

protected int|false|null $_pageSize = false

if page size is false, then we works with all items

$_priceDataFieldFilters

Additional field filters, applied in _productLimitationJoinPrice()

protected array<string|int, mixed> $_priceDataFieldFilters = []

$_priceExpression

Price expression sql

protected string|null $_priceExpression

$_pricesCount

Prises count (statistics data)

protected int|null $_pricesCount = \null

$_priceStandardDeviation

Prise standard deviation (statistics data)

protected float|null $_priceStandardDeviation

$_productCategoryTable

Product categories table name

protected string $_productCategoryTable

$_productCountSelect

Category product count select

protected Select|null $_productCountSelect = \null

$_productLimitationFilters

Product limitation filters Allowed filters store_id int; category_id int; category_is_anchor int; visibility array|int; website_ids array|int; store_table string; use_price_index bool; join price index table flag customer_group_id int; required for price; customer group limitation for price website_id int; required for price; website limitation for price

protected array<string|int, mixed> $_productLimitationFilters = []

$_productWebsiteTable

Product websites table name

protected string $_productWebsiteTable

$_select

Select oblect

protected Select $_select

$_selectAttributes

Attributes to be fetched for objects in collection

protected array<string|int, mixed> $_selectAttributes = []

$_selectEntityTypes

Entity types to be fetched for objects in collection

protected array<string|int, mixed> $_selectEntityTypes = []

$_staticFields

Entity static fields

protected array<string|int, mixed> $_staticFields = []

$_storeId

Current scope (store Id)

protected int|null $_storeId

$_totalRecords

Total items number

protected int|null $_totalRecords

$_urlRewriteCategory

Add URL rewrite for category

protected int|string $_urlRewriteCategory = ''

$_useAnalyticFunction

Use analytic function flag If true - allows to prepare final select with analytic functions

protected bool $_useAnalyticFunction = \false

Methods

__clone()

Magic clone function

public __clone() : void

Clone also Select

_loadAttributes()

Load attributes into loaded entities

public _loadAttributes([bool $printQuery = false ][, bool $logQuery = false ]) : $this
Parameters
$printQuery : bool = false
$logQuery : bool = false
Tags
throws
Mage_Core_Exception
Mage_Eav_Exception
Return values
$this

_loadEntities()

Load entities records into items

public _loadEntities([bool $printQuery = false ][, bool $logQuery = false ]) : $this
Parameters
$printQuery : bool = false
$logQuery : bool = false
Tags
throws
Mage_Core_Exception
Return values
$this

_prepareSelect()

Prepare select for load

public _prepareSelect(Select $select) : string
Parameters
$select : Select

OPTIONAL

Return values
string

addAttributeToFilter()

Add attribute filter to collection

public addAttributeToFilter(mixed $attribute[, mixed $condition = null ][, mixed $joinType = 'inner' ]) : $this

If $attribute is an array will add OR condition with following format: [ ['attribute'=>'firstname', 'like'=>'test%'], ['attribute'=>'lastname', 'like'=>'test%'], ]

Parameters
$attribute : mixed
$condition : mixed = null
$joinType : mixed = 'inner'
Attributes
#[Override]
Return values
$this

addAttributeToSelect()

Add attribute to entities in collection

public addAttributeToSelect(array<string|int, mixed>|string|int|Mage_Core_Model_Config_Element $attribute[, bool|string $joinType = false ]) : $this

If $attribute=='*' select all attributes

Parameters
$attribute : array<string|int, mixed>|string|int|Mage_Core_Model_Config_Element
$joinType : bool|string = false

flag for joining attribute

Return values
$this

addAttributeToSort()

Add attribute to sort order

public addAttributeToSort(mixed $attribute[, mixed $dir = self::SORT_ORDER_ASC ]) : $this
Parameters
$attribute : mixed
$dir : mixed = self::SORT_ORDER_ASC
Attributes
#[Override]
Return values
$this

addBindParam()

Add variable to bind list

public addBindParam(string $name, mixed $value) : $this
Parameters
$name : string
$value : mixed
Return values
$this

addCategoryIds()

Add category ids to loaded items

public addCategoryIds() : $this
Return values
$this

addEntityTypeToSelect()

public addEntityTypeToSelect(string $entityType, string $prefix) : $this
Parameters
$entityType : string
$prefix : string
Return values
$this

addExcludeProductFilter()

Exclude products from filter

public addExcludeProductFilter(array<string|int, mixed> $products) : $this
Parameters
$products : array<string|int, mixed>
Return values
$this

addExpressionAttributeToSelect()

Add attribute expression (SUM, COUNT, etc)

public addExpressionAttributeToSelect(string $alias, string $expression, string|array<string|int, mixed> $attribute) : $this

Example: ('sub_total', 'SUM({{attribute}})', 'revenue') Example: ('sub_total', 'SUM({{revenue}})', 'revenue')

For some functions like SUM use groupByAttribute.

Parameters
$alias : string
$expression : string
$attribute : string|array<string|int, mixed>
Return values
$this

addFieldToFilter()

Wrapper for compatibility with \Maho\Data\Collection\Db

public addFieldToFilter(mixed $attribute[, mixed $condition = null ]) : $this
Parameters
$attribute : mixed
$condition : mixed = null
Attributes
#[Override]
Return values
$this

addFilter()

Add collection filter

public addFilter(string $field, string|array<string|int, mixed> $value[, string $type = 'and' ]) : $this
Parameters
$field : string
$value : string|array<string|int, mixed>
$type : string = 'and'

and|or|string

Return values
$this

addFilterByRequiredOptions()

Filter products with required options

public addFilterByRequiredOptions() : $this
Return values
$this

addFilterToMap()

Add filter to Map

public addFilterToMap(string $filter, string $alias[, string $group = 'fields' ]) : $this
Parameters
$filter : string
$alias : string
$group : string = 'fields'

default 'fields'

Return values
$this

addIdFilter()

Add collection filters by identifiers

public addIdFilter(mixed $productId[, bool $exclude = false ]) : $this
Parameters
$productId : mixed
$exclude : bool = false
Return values
$this

addItem()

Skip duplicate items when DISTINCT deduplication is active, which can happen when multiple parent products link to the same target (e.g. cart cross-sells)

public addItem(DataObject $item) : $this
Parameters
$item : DataObject
Attributes
#[Override]
Return values
$this

addLinkModelFieldToFilter()

Add specific link model attribute to collection filter

public addLinkModelFieldToFilter(string $attributeCode[, array<string|int, mixed>|null $condition = null ]) : $this
Parameters
$attributeCode : string
$condition : array<string|int, mixed>|null = null
Return values
$this

addOptionsToResult()

Adding product custom options to result collection

public addOptionsToResult() : $this
Return values
$this

addOrder()

self::setOrder() alias

public addOrder(string $field[, string $direction = self::SORT_ORDER_DESC ]) : $this
Parameters
$field : string
$direction : string = self::SORT_ORDER_DESC
Return values
$this

addPriceData()

Add Price Data to result

public addPriceData([int $customerGroupId = null ][, int $websiteId = null ]) : $this
Parameters
$customerGroupId : int = null
$websiteId : int = null
Return values
$this

addPriceDataFieldFilter()

Add field comparison expression

public addPriceDataFieldFilter(string $comparisonFormat, array<string|int, mixed> $fields) : $this
Parameters
$comparisonFormat : string
  • expression for sprintf()
$fields : array<string|int, mixed>
  • list of fields
Tags
throws
Exception
Return values
$this

addProductFilter()

Add products to filter

public addProductFilter(array<string|int, mixed>|int|string $products) : $this
Parameters
$products : array<string|int, mixed>|int|string
Return values
$this

addStaticField()

Add field to static

public addStaticField(string $field) : $this
Parameters
$field : string
Return values
$this

addStoreFilter()

Add store availability filter. Include availability product for store website

public addStoreFilter([mixed $store = null ]) : $this
Parameters
$store : mixed = null
Return values
$this

addTaxPercents()

Add requere tax percent flag for product collection

public addTaxPercents() : $this
Return values
$this

addTierPriceData()

Add tier price data to loaded items

public addTierPriceData() : $this
Return values
$this

addUrlRewrite()

Add URL rewrites data to product If collection loadded - run processing else set flag

public addUrlRewrite([int|string $categoryId = '' ]) : $this
Parameters
$categoryId : int|string = ''
Return values
$this

addWebsiteFilter()

Add website filter to collection

public addWebsiteFilter([array<string|int, mixed>|string|int $websites = null ]) : $this
Parameters
$websites : array<string|int, mixed>|string|int = null
Return values
$this

addWebsiteNamesToResult()

Adding product website names to result collection Add for each product websites information

public addWebsiteNamesToResult() : $this
Return values
$this

applyFrontendPriceLimitations()

Apply front-end price limitation filters to the collection

public applyFrontendPriceLimitations() : $this
Return values
$this

clear()

Clear collection

public clear() : $this
Attributes
#[Override]
Return values
$this

count()

Retrieve count of collection loaded items

public count() : int
Attributes
#[Override]
#[ReturnTypeWillChange]
Return values
int

delete()

Delete all the entities in the collection

public delete() : mixed
Tags
todo

make batch delete directly from collection

distinct()

Set select distinct

public distinct(bool $flag) : $this
Parameters
$flag : bool
Attributes
#[Override]
Return values
$this

each()

public each(callable $obj_method[, array<string|int, mixed> $args = [] ]) : void
Parameters
$obj_method : callable
$args : array<string|int, mixed> = []

exportToArray()

Get collection data as a 2D array

public exportToArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

fetchItem()

Returns a collection item that corresponds to the fetched row and moves the internal data pointer ahead

public fetchItem() : DataObject|bool
Return values
DataObject|bool

getAdditionalPriceExpression()

Get additional price expression sql part

public getAdditionalPriceExpression(Select $select) : string
Parameters
$select : Select
Return values
string

getAllAttributeValues()

Return all attribute values as array in form: [ [entity_id_1] => [ [store_id_1] => store_value_1, [store_id_2] => store_value_2, ... [store_id_n] => store_value_n ], ... ]

public getAllAttributeValues(string $attribute) : array<string|int, mixed>
Parameters
$attribute : string

attribute code

Return values
array<string|int, mixed>

getAllIds()

Retrieve all ids for collection

public getAllIds([mixed $limit = null ][, mixed $offset = null ]) : array<string|int, mixed>
Parameters
$limit : mixed = null
$offset : mixed = null
Attributes
#[Override]
Return values
array<string|int, mixed>

getAllIdsCache()

Retrieve all ids

public getAllIdsCache([bool $resetCache = false ]) : array<string|int, mixed>
Parameters
$resetCache : bool = false
Return values
array<string|int, mixed>

getAttributeValueCount()

Retrieve product count by some value of attribute

public getAttributeValueCount(string $attribute) : array<string|int, mixed>
Parameters
$attribute : string
Return values
array<string|int, mixed> —

($value=>$count)

getAttributeValueCountByRange()

Retrieve ranging product count for attribute range

public getAttributeValueCountByRange(string $attribute, int $range) : array<string|int, mixed>
Parameters
$attribute : string
$range : int
Return values
array<string|int, mixed>

getCacheKey()

public getCacheKey() : string
Return values
string

getCacheLifetime()

public getCacheLifetime() : int
Return values
int

getCacheTags()

public getCacheTags() : array<string|int, mixed>
Return values
array<string|int, mixed>

getCatalogPreparedSelect()

Get cloned Select after dispatching 'catalog_prepare_price_select' event

public getCatalogPreparedSelect() : Select|null
Return values
Select|null

getColumnValues()

Retrieve field values from all items

public getColumnValues(string $colName) : array<string|int, mixed>
Parameters
$colName : string
Return values
array<string|int, mixed>

getCurPage()

Get current collection page

public getCurPage([int $displacement = 0 ]) : int
Parameters
$displacement : int = 0
Return values
int

getCurrencyRate()

Get currency rate

public getCurrencyRate() : float
Return values
float

getData()

Get all data array for collection

public getData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getDefaultStoreId()

Retrieve default store id

public getDefaultStoreId() : int
Return values
int

getFilter()

Search for a filter by specified field

public getFilter(string|array<string|int, mixed> $field) : DataObject|array<string|int, mixed>|null

Multiple filters can be matched if an array is specified:

  • 'foo' -- get the first filter with field name 'foo'
  • array('foo') -- get all filters with field name 'foo'
  • array('foo', 'bar') -- get all filters with field name 'foo' or 'bar'
  • array() -- get all filters
Parameters
$field : string|array<string|int, mixed>
Return values
DataObject|array<string|int, mixed>|null

getFlag()

Retrieve Flag

public getFlag(string $flag) : mixed
Parameters
$flag : string

getIdFieldName()

Id field name getter

public getIdFieldName() : string
Return values
string

getItemByColumnValue()

Search first item by field value

public getItemByColumnValue(string $column, mixed $value) : DataObject|null
Parameters
$column : string
$value : mixed
Return values
DataObject|null

getItemsByColumnValue()

Search all items by field value

public getItemsByColumnValue(string $column, mixed $value) : array<string|int, mixed>
Parameters
$column : string
$value : mixed
Return values
array<string|int, mixed>

getIterator()

Implementation of IteratorAggregate::getIterator()

public getIterator() : mixed
Attributes
#[Override]
#[ReturnTypeWillChange]

getLastPageNumber()

Retrieve collection last page number

public getLastPageNumber() : int
Return values
int

getLimitationFilters()

Get filters applied to collection

public getLimitationFilters() : array<string|int, mixed>
Return values
array<string|int, mixed>

getLoadedIds()

Returns already loaded element ids

public getLoadedIds() : mixed

return array

getMaxAttributeValue()

Retrieve max value by attribute

public getMaxAttributeValue(string $attribute) : mixed
Parameters
$attribute : string

getMaxPrice()

Get products max price

public getMaxPrice() : float
Return values
float

getMinPrice()

Get products min price

public getMinPrice() : float
Return values
float

getPageSize()

Retrieve collection page size

public getPageSize() : int
Return values
int

getPriceExpression()

Get price expression sql part

public getPriceExpression(Select $select) : string
Parameters
$select : Select
Return values
string

getPricesCount()

Get count of product prices

public getPricesCount() : int
Return values
int

getPriceStandardDeviation()

Get standard deviation of products price

public getPriceStandardDeviation() : float
Return values
float

getProductCountSelect()

Retrieve product count select for categories

public getProductCountSelect() : Select
Return values
Select

getProductTypeIds()

Return array of unique product type ids in collection

public getProductTypeIds() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRowIdFieldName()

Retrieve row id field name

public getRowIdFieldName() : string
Return values
string

getSelect()

Get Select instance

public getSelect() : Select
Return values
Select

getSelectCountSql()

Get SQL for get record count without left JOINs

public getSelectCountSql() : Select
Attributes
#[Override]
Return values
Select

getSelectSql()

Get sql select string or object

public getSelectSql([bool $stringMode = false ]) : string|Select
Parameters
$stringMode : bool = false
Return values
string|Select

getSetIds()

Retrieve unique attribute set ids in collection

public getSetIds() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSize()

Get collection size

public getSize() : int
Attributes
#[Override]
Return values
int

getStoreId()

Return current store id

public getStoreId() : int
Return values
int

getTable()

Retrieve table name

public getTable(string $table) : string
Parameters
$table : string
Return values
string

groupByAttribute()

Groups results by specified attribute

public groupByAttribute(string|array<string|int, mixed> $attribute) : $this
Parameters
$attribute : string|array<string|int, mixed>
Return values
$this

hasFlag()

Has Flag

public hasFlag(string $flag) : bool
Parameters
$flag : string
Return values
bool

importFromArray()

Import 2D array into collection as objects

public importFromArray(array<string|int, mixed> $arr) : $this

If the imported items already exist, update the data for existing objects

Parameters
$arr : array<string|int, mixed>
Return values
$this

initCache()

Initialize collection cache

public initCache(mixed $object, string $idPrefix, array<string|int, mixed> $tags) : $this
Parameters
$object : mixed
$idPrefix : string
$tags : array<string|int, mixed>
Return values
$this

isLoaded()

Retrieve collection loading status

public isLoaded() : bool
Return values
bool

isModuleEnabled()

public isModuleEnabled(string $moduleName[, string $helperAlias = 'core' ]) : bool
Parameters
$moduleName : string
$helperAlias : string = 'core'
Return values
bool

joinAttribute()

Add attribute from joined entity to select

public joinAttribute(string $alias, string|Mage_Eav_Model_Entity_Attribute_Abstract $attribute, string $bind[, string $filter = null ][, string $joinType = 'inner' ][, int $storeId = null ]) : $this

Examples: ('billing_firstname', 'customer_address/firstname', 'default_billing') ('billing_lastname', 'customer_address/lastname', 'default_billing') ('shipping_lastname', 'customer_address/lastname', 'default_billing') ('shipping_postalcode', 'customer_address/postalcode', 'default_shipping') ('shipping_city', $cityAttribute, 'default_shipping')

Developer is encouraged to use existing instances of attributes and entities After first use of string entity name it will be cached in the collection

Parameters
$alias : string

alias for the joined attribute

$attribute : string|Mage_Eav_Model_Entity_Attribute_Abstract
$bind : string

attribute of the main entity to link with joined $filter

$filter : string = null

primary key for the joined entity (entity_id default)

$joinType : string = 'inner'

inner|left

$storeId : int = null
Tags
throws
Mage_Core_Exception
Mage_Eav_Exception
todo

connect between joined attributes of same entity

Return values
$this

joinAttributes()

Join attributes

public joinAttributes() : $this
Return values
$this

joinField()

Join regular table field and use an attribute as fk

public joinField(string $alias, string $table, string $field, string $bind[, string|array<string|int, mixed> $cond = null ][, string $joinType = 'inner' ]) : $this

Examples: ('country_name', 'directory/country_name', 'name', 'country_id=shipping_country', "{{table}}.language_code='en'", 'left')

Parameters
$alias : string

'country_name'

$table : string

'directory/country_name'

$field : string

'name'

$bind : string

'PK(country_id)=FK(shipping_country_id)'

$cond : string|array<string|int, mixed> = null

"{{table}}.language_code='en'" OR ['language_code'=>'en']

$joinType : string = 'inner'

'left'

Return values
$this

joinMinimalPrice()

Join minimal price attribute to result

public joinMinimalPrice() : $this
Return values
$this

joinTable()

Join a table

public joinTable(array<string|int, mixed>|string|Expr $table, string $bind[, string|array<string|int, mixed> $fields = null ][, string|array<string|int, mixed>|null $cond = null ][, string $joinType = 'inner' ]) : $this
Parameters
$table : array<string|int, mixed>|string|Expr
$bind : string
$fields : string|array<string|int, mixed> = null
$cond : string|array<string|int, mixed>|null = null
$joinType : string = 'inner'
Return values
$this

load()

Load collection data into object items

public load([bool $printQuery = false ][, bool $logQuery = false ]) : $this
Parameters
$printQuery : bool = false
$logQuery : bool = false
Tags
throws
Mage_Core_Exception
Mage_Eav_Exception
Attributes
#[Override]
Return values
$this

loadData()

Load data

public loadData([bool $printQuery = false ][, bool $logQuery = false ]) : $this
Parameters
$printQuery : bool = false
$logQuery : bool = false
Attributes
#[Override]
Return values
$this

printLogQuery()

Print and/or log query

public printLogQuery([bool $printQuery = false ][, bool $logQuery = false ][, string $sql = null ]) : $this
Parameters
$printQuery : bool = false
$logQuery : bool = false
$sql : string = null
Return values
$this

removeAttributeToSelect()

Remove an attribute from selection list

public removeAttributeToSelect([string $attribute = null ]) : $this
Parameters
$attribute : string = null
Return values
$this

removeItemByKey()

Remove item from collection by item key

public removeItemByKey(mixed $key) : $this
Parameters
$key : mixed
Return values
$this

requireTaxPercent()

Get require tax percent flag value

public requireTaxPercent() : bool
Return values
bool

resetData()

Reset loaded for collection data array

public resetData() : $this
Return values
$this

save()

Save all the entities in the collection

public save() : mixed
Tags
todo

make batch save directly from collection

setAllIdsCache()

Set all ids

public setAllIdsCache(array<string|int, mixed> $value) : $this
Parameters
$value : array<string|int, mixed>
Return values
$this

setAttributeSetIdOrder()

Enable sorting products by its attribute set name

public setAttributeSetIdOrder([string $dir = self::SORT_ORDER_ASC ]) : $this
Parameters
$dir : string = self::SORT_ORDER_ASC

sort type asc|desc

Return values
$this

setCacheKey()

public setCacheKey(string $key) : $this
Parameters
$key : string
Return values
$this

setCacheTags()

public setCacheTags(array<string|int, mixed> $tags) : $this
Parameters
$tags : array<string|int, mixed>
Return values
$this

setCurPage()

Set current page

public setCurPage(int|null $page) : $this
Parameters
$page : int|null
Return values
$this

setDataToAll()

Setting data for all collection items

public setDataToAll(mixed $key[, mixed $value = null ]) : $this
Parameters
$key : mixed
$value : mixed = null
Return values
$this

setFlag()

Set Flag

public setFlag(string $flag[, mixed $value = null ]) : $this
Parameters
$flag : string
$value : mixed = null
Return values
$this

setGroupBy()

Setting distinct to exclude duplications in collection

public setGroupBy([string $groupBy = 'e.entity_id' ]) : $this
Parameters
$groupBy : string = 'e.entity_id'

Kept for backward compatibility, now ignored

Return values
$this

setIsStrongMode()

Enable strong mode for inner join of linked products

public setIsStrongMode() : $this
Return values
$this

setItemObjectClass()

Set collection item class name

public setItemObjectClass(string $className) : $this
Parameters
$className : string
Return values
$this

setObject()

Set template object for the collection

public setObject([DataObject $object = null ]) : $this
Parameters
$object : DataObject = null
Return values
$this

setOrder()

Set sorting order

public setOrder(mixed $attribute[, mixed $dir = self::SORT_ORDER_ASC ]) : $this

$attribute can also be an array of attributes

Parameters
$attribute : mixed
$dir : mixed = self::SORT_ORDER_ASC
Attributes
#[Override]
Return values
$this

setPage()

Set collection page start and records to show

public setPage(int $pageNum, int $pageSize) : $this
Parameters
$pageNum : int
$pageSize : int
Return values
$this

setPageSize()

Set collection page size

public setPageSize(int|null $size) : $this
Parameters
$size : int|null
Return values
$this

setPositionOrder()

Enable sorting products by its position

public setPositionOrder([string $dir = self::SORT_ORDER_ASC ]) : $this
Parameters
$dir : string = self::SORT_ORDER_ASC

sort type asc|desc

Return values
$this

setRandomOrder()

Add random sorting order

public setRandomOrder() : $this
Return values
$this

setRowIdFieldName()

Set row id field name

public setRowIdFieldName(string $fieldName) : $this
Parameters
$fieldName : string
Return values
$this

setVisibility()

Set product visibility filter for enabled products

public setVisibility(array<string|int, mixed> $visibility) : $this
Parameters
$visibility : array<string|int, mixed>
Return values
$this

toArray()

Retrieve array of attributes

public toArray([array<string|int, mixed> $arrAttributes = [] ]) : array<string|int, mixed>
Parameters
$arrAttributes : array<string|int, mixed> = []
Attributes
#[Override]
Return values
array<string|int, mixed>

toOptionArray()

public toOptionArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

toOptionHash()

public toOptionHash() : array<string|int, mixed>
Return values
array<string|int, mixed>

toXml()

Convert collection to XML

public toXml() : string
Return values
string

unshiftOrder()

Add select order to the beginning

public unshiftOrder(string $field[, string $direction = self::SORT_ORDER_DESC ]) : $this
Parameters
$field : string
$direction : string = self::SORT_ORDER_DESC
Return values
$this

unsProductCountSelect()

Destruct product count select

public unsProductCountSelect() : $this
Return values
$this

walk()

Walk through the collection and run model method or external callback with optional arguments

public walk(string|callable $callback[, array<string|int, mixed> $args = [] ]) : array<string|int, mixed>

Returns array with results of callback for each item

Parameters
$callback : string|callable
$args : array<string|int, mixed> = []
Return values
array<string|int, mixed>

_addAttributeJoin()

Add attribute value table to the join if it wasn't added previously

protected _addAttributeJoin(string $attributeCode[, bool|string $joinType = 'inner' ]) : $this
Parameters
$attributeCode : string
$joinType : bool|string = 'inner'

inner|left

Tags
throws
Mage_Eav_Exception
Return values
$this

_addFinalPrice()

Add final price to the product

protected _addFinalPrice() : $this
Return values
$this

_addLoadAttributesSelectValues()

protected _addLoadAttributesSelectValues(Select $select, string $table, string $type) : Select
Parameters
$select : Select
$table : string
$type : string
Attributes
#[Override]
Return values
Select

_addUrlRewrite()

Add URL rewrites to collection

protected _addUrlRewrite() : mixed

_afterLoad()

Processing collection items after loading Adding url rewrites, minimal prices, final prices, tax percents

protected _afterLoad() : $this
Attributes
#[Override]
Return values
$this

_afterLoadData()

Process loaded collection data

protected _afterLoadData() : $this
Return values
$this

_applyProductLimitations()

Apply limitation filters to collection Method allows using one time category product index table (or product website table) for different combinations of store_id/category_id/visibility filter states Method supports multiple changes in one collection object for this parameters

protected _applyProductLimitations() : $this
Return values
$this

_applyZeroStoreProductLimitations()

Apply limitation filters to collection base on API Method allows using one time category product table for combinations of category_id filter states

protected _applyZeroStoreProductLimitations() : $this
Return values
$this

_beforeLoad()

Join linked products when specified link model

protected _beforeLoad() : $this
Attributes
#[Override]
Return values
$this

_construct()

Initialize collection

protected _construct() : mixed
Attributes
#[Override]

_fetchAll()

Fetch collection data

protected _fetchAll(Select|string $select) : array<string|int, mixed>
Parameters
$select : Select|string
Return values
array<string|int, mixed>

_getAllIdsSelect()

Clone and reset collection

protected _getAllIdsSelect([int $limit = null ][, int $offset = null ]) : Select
Parameters
$limit : int = null
$offset : int = null
Tags
throws
Mage_Core_Exception
Return values
Select

_getAttributeCodeByValueInfo()

protected _getAttributeCodeByValueInfo(array<string, mixed> $valueInfo) : string
Parameters
$valueInfo : array<string, mixed>
Return values
string

_getAttributeConditionSql()

Get condition sql for the attribute

protected _getAttributeConditionSql(string $attribute, mixed $condition[, string $joinType = 'inner' ]) : string
Parameters
$attribute : string
$condition : mixed
$joinType : string = 'inner'
Tags
see
self::_getConditionSql
Return values
string

_getAttributeFieldName()

Retrieve attribute field name by attribute code

protected _getAttributeFieldName(string $attributeCode) : string
Parameters
$attributeCode : string
Return values
string

_getAttributeTableAlias()

Get alias for attribute value table

protected _getAttributeTableAlias(string $attributeCode) : string
Parameters
$attributeCode : string
Return values
string

_getCacheTags()

Get cache tags list

protected _getCacheTags() : array<string|int, mixed>
Return values
array<string|int, mixed>

_getConditionFieldName()

protected _getConditionFieldName(string $fieldName) : string
Parameters
$fieldName : string
Return values
string

_getConditionSql()

Build SQL statement for condition

protected _getConditionSql(string $fieldName, int|string|array<string|int, mixed> $condition) : string

If $condition integer or string - exact value will be filtered ('eq' condition)

If $condition is array - one of the following structures is expected:

  • array("from" => $fromValue, "to" => $toValue)
  • array("eq" => $equalValue)
  • array("neq" => $notEqualValue)
  • array("like" => $likeValue)
  • array("in" => array($inValues))
  • array("nin" => array($notInValues))
  • array("notnull" => $valueIsNotNull)
  • array("null" => $valueIsNull)
  • array("moreq" => $moreOrEqualValue)
  • array("gt" => $greaterValue)
  • array("lt" => $lessValue)
  • array("gteq" => $greaterOrEqualValue)
  • array("lteq" => $lessOrEqualValue)
  • array("finset" => $valueInSet)
  • array("regexp" => $regularExpression)
  • array("seq" => $stringValue)
  • array("sneq" => $stringValue)

If non matched - sequential array is expected and OR conditions will be built using above mentioned structure

Parameters
$fieldName : string

Field name must be already escaped with AdapterInterface::quoteIdentifier()

$condition : int|string|array<string|int, mixed>
Return values
string

_getItemId()

Get collection item identifier

protected _getItemId(DataObject $item) : mixed
Parameters
$item : DataObject
Attributes
#[Override]

_getLinkAttributeTableAlias()

Get table alias for link model attribute

protected _getLinkAttributeTableAlias(string $attributeCode, string $attributeType) : string
Parameters
$attributeCode : string
$attributeType : string
Return values
string

_getLoadAttributesSelect()

Retrieve attributes load select

protected _getLoadAttributesSelect(string $table[, array<string|int, mixed>|int $attributeIds = [] ]) : Select
Parameters
$table : string
$attributeIds : array<string|int, mixed>|int = []
Tags
throws
Mage_Core_Exception
Attributes
#[Override]
Return values
Select

_getMappedField()

Try to get mapped field name for filter to collection

protected _getMappedField(string $field) : string
Parameters
$field : string
Return values
string

_getMapper()

Retrieve mapper data

protected _getMapper() : array<string|int, mixed>|bool|null
Return values
array<string|int, mixed>|bool|null

_getSelectCacheId()

Get cache identifier base on select

protected _getSelectCacheId(Select|string $select) : string
Parameters
$select : Select|string
Return values
string

_getSelectCountSql()

Get SQL for get record count

protected _getSelectCountSql([Select|null $select = null ][, bool $resetLeftJoins = true ]) : Select
Parameters
$select : Select|null = null
$resetLeftJoins : bool = true
Return values
Select

_init()

Standard resource collection initialization

protected _init(string $model[, null|string $entityModel = null ]) : $this
Parameters
$model : string
$entityModel : null|string = null
Return values
$this

_initSelect()

Initialize collection select Redeclared for remove entity_type_id condition in catalog_product_entity we store just products

protected _initSelect() : $this
Attributes
#[Override]
Return values
$this

_initTables()

Define product website and category product tables

protected _initTables() : mixed

_joinAttributeToSelect()

Adding join statement to collection select instance

protected _joinAttributeToSelect(string $method, object $attribute, string $tableAlias, array<string|int, mixed> $condition, string $fieldCode, string $fieldAlias) : Mage_Eav_Model_Entity_Collection_Abstract
Parameters
$method : string
$attribute : object
$tableAlias : string
$condition : array<string|int, mixed>
$fieldCode : string
$fieldAlias : string
Attributes
#[Override]
Return values
Mage_Eav_Model_Entity_Collection_Abstract

Join linked products and their attributes

protected _joinLinks() : $this
Return values
$this

_joinPriceRules()

Join prices from price rules to products collection

protected _joinPriceRules() : $this
Return values
$this

_loadCache()

Load cached data for select

protected _loadCache(Select $select) : string|false
Parameters
$select : Select
Return values
string|false

_prepareOrderExpression()

Retrieve attribute expression by specified column

protected _prepareOrderExpression(string $field) : string|Expr
Parameters
$field : string
Return values
string|Expr

_preparePriceExpressionParameters()

Prepare additional price expression sql part

protected _preparePriceExpressionParameters(Select $select) : $this
Parameters
$select : Select
Return values
$this

_prepareProductLimitationFilters()

Prepare limitation filters

protected _prepareProductLimitationFilters() : $this
Return values
$this

_prepareStaticFields()

Prepare static entity fields

protected _prepareStaticFields() : $this
Return values
$this

_prepareStatisticsData()

Prepare statistics data

protected _prepareStatisticsData() : $this
Return values
$this

_productLimitationJoinPrice()

Join Product Price Table

protected _productLimitationJoinPrice() : $this
Return values
$this

_productLimitationJoinStore()

Join additional (alternative) store visibility filter

protected _productLimitationJoinStore() : $this
Return values
$this

_productLimitationJoinWebsite()

Join website product limitation

protected _productLimitationJoinWebsite() : $this
Return values
$this

_renderFilters()

Render sql select conditions

protected _renderFilters() : $this
Attributes
#[Override]
Return values
$this

_renderFiltersBefore()

Hook for operations before rendering filters

protected _renderFiltersBefore() : mixed

_renderLimit()

Render sql select limit

protected _renderLimit() : $this
Attributes
#[Override]
Return values
$this

_renderOrders()

Treat "order by" items as attributes to sort

protected _renderOrders() : $this
Attributes
#[Override]
Return values
$this

_reset()

Reset collection

protected _reset() : $this
Attributes
#[Override]
Return values
$this

_saveCache()

Save collection data to cache

protected _saveCache(array<string|int, mixed> $data, Select $select) : $this
Parameters
$data : array<string|int, mixed>
$select : Select
Return values
$this

_setIdFieldName()

Specify collection objects id field name

protected _setIdFieldName(string $fieldName) : $this
Parameters
$fieldName : string
Return values
$this

_setIsLoaded()

Set collection loading status flag

protected _setIsLoaded([bool $flag = true ]) : $this
Parameters
$flag : bool = true
Return values
$this

_setItemAttributeValue()

Initialize entity object property value

protected _setItemAttributeValue(array<string|int, mixed> $valueInfo) : $this
Parameters
$valueInfo : array<string|int, mixed>
Attributes
#[Override]
Return values
$this

_setPriceScopeOnItems()

A product carries no store of its own, so a price read outside a storefront would resolve the rate against whatever store is current.

protected _setPriceScopeOnItems() : void

_toOptionArray()

Convert items array to array for select options

protected _toOptionArray([string $valueField = 'id' ][, string $labelField = 'name' ][, array<string|int, mixed> $additional = [] ]) : array<string|int, mixed>

return items array array( $index => array( 'value' => mixed 'label' => mixed ) )

Parameters
$valueField : string = 'id'
$labelField : string = 'name'
$additional : array<string|int, mixed> = []
Return values
array<string|int, mixed>

_toOptionHash()

Convert items array to hash for select options

protected _toOptionHash([string $valueField = 'id' ][, string $labelField = 'name' ]) : array<string|int, mixed>

return items hash array($value => $label)

Parameters
$valueField : string = 'id'
$labelField : string = 'name'
Return values
array<string|int, mixed>

_toOptionHashOptimized()

Convert items array to hash for select options unsing fetchItem method

protected _toOptionHashOptimized([string $valueField = 'id' ][, string $labelField = 'name' ]) : array<string|int, mixed>

The difference between _toOptionHash() and this one is that this method fetch items one by one and does not load all collection items at once return items hash array($value => $label)

Parameters
$valueField : string = 'id'
$labelField : string = 'name'
Tags
see
fetchItem()
Return values
array<string|int, mixed>

_translateCondition()

Build sql where condition part

protected _translateCondition(string|array<string|int, mixed> $field, int|string|array<string|int, mixed> $condition) : string
Parameters
$field : string|array<string|int, mixed>
$condition : int|string|array<string|int, mixed>
Return values
string
On this page

Search results