class Listing implements Zend_Paginator_Adapter_Interface, Zend_Paginator_AdapterAggregate, Iterator

Class Listing

Constants

ORDERKEY_PRICE

VARIANT_MODE_HIDE

Variant mode defines how to consider variants in product list results - does not consider variants in search results.

VARIANT_MODE_INCLUDE

Variant mode defines how to consider variants in product list results - considers variants in search results and returns objects and variants.

VARIANT_MODE_INCLUDE_PARENT_OBJECT

Variant mode defines how to consider variants in product list results - considers variants in search results but only returns corresponding objects in search results.

Properties

Index|null $index

Methods

__construct( Index $index)

Listing constructor.

getProducts()

Returns all products valid for this search.

addCondition( Condition $condition, string $fieldName)

Adds filter condition to product list Fieldname is optional but highly recommended - needed for resetting condition based on fieldname and exclude functionality in group by results.

addQueryCondition( Condition $condition, string $fieldName)

Adds query condition to product list for fulltext search Fieldname is optional but highly recommended - needed for resetting condition based on fieldname and exclude functionality in group by results.

addRelationCondition( Condition $condition, string $fieldName)

Adds relation condition to product list.

resetCondition($fieldName)

Reset filter condition for fieldname.

resetQueryCondition($fieldName)

Reset query condition for fieldname.

resetConditions()

Resets all conditions of product list.

setOrder($order)

sets order direction.

string
getOrder()

gets order direction.

setOrderKey($orderKey)

sets order key.

string
getOrderKey()

No description

setLimit($limit)

No description

int
getLimit()

No description

setOffset($offset)

No description

int
getOffset()

No description

setCategory( Category $category)

No description

getCategory()

No description

setShop( Shop $shop)

No description

getShop()

No description

setVariantMode($variantMode)

No description

string
getVariantMode()

No description

load()

loads search results from index and returns them.

array
getGroupByValues($fieldName, bool $countValues = false, bool $fieldNameShouldBeExcluded = true)

loads group by values based on fieldname either from local variable if prepared or directly from product index.

array
getGroupByRelationValues($fieldName, bool $countValues = false, bool $fieldNameShouldBeExcluded = true)

loads group by values based on relation fieldname either from local variable if prepared or directly from product index.

array
getGroupBySystemValues($fieldName, bool $countValues = false, bool $fieldNameShouldBeExcluded = true)

loads group by values based on relation fieldname either from local variable if prepared or directly from product index.

buildSimilarityOrderBy($fields, $objectId)

returns order by statement for similarity calculations based on given fields and object ids returns cosine similarity calculation

Index|null
getIndex()

No description

setIndex( Index|null $index)

No description

string
getLocale()

No description

setLocale( string $locale)

No description

Details

at line line 66
__construct( Index $index)

Listing constructor.

Parameters

Index $index

at line line 76
abstract Product[] getProducts()

Returns all products valid for this search.

Return Value

Product[]

at line line 86
abstract addCondition( Condition $condition, string $fieldName)

Adds filter condition to product list Fieldname is optional but highly recommended - needed for resetting condition based on fieldname and exclude functionality in group by results.

Parameters

Condition $condition
string $fieldName

at line line 96
abstract addQueryCondition( Condition $condition, string $fieldName)

Adds query condition to product list for fulltext search Fieldname is optional but highly recommended - needed for resetting condition based on fieldname and exclude functionality in group by results.

Parameters

Condition $condition
string $fieldName

at line line 104
abstract addRelationCondition( Condition $condition, string $fieldName)

Adds relation condition to product list.

Parameters

Condition $condition
string $fieldName

at line line 111
abstract resetCondition($fieldName)

Reset filter condition for fieldname.

Parameters

$fieldName

at line line 118
abstract resetQueryCondition($fieldName)

Reset query condition for fieldname.

Parameters

$fieldName

at line line 123
abstract resetConditions()

Resets all conditions of product list.

at line line 130
abstract setOrder($order)

sets order direction.

Parameters

$order

at line line 137
abstract string getOrder()

gets order direction.

Return Value

string

at line line 144
abstract setOrderKey($orderKey)

sets order key.

Parameters

$orderKey string | array - either single field name, or array of field names or array of arrays (field name, direction)

at line line 149
abstract string getOrderKey()

Return Value

string | array

at line line 154
abstract setLimit($limit)

Parameters

$limit int

at line line 159
abstract int getLimit()

Return Value

int

at line line 164
abstract setOffset($offset)

Parameters

$offset int

at line line 169
abstract int getOffset()

Return Value

int

at line line 174
abstract setCategory( Category $category)

Parameters

Category $category

at line line 179
abstract Category getCategory()

Return Value

Category

at line line 184
abstract setShop( Shop $shop)

Parameters

Shop $shop

at line line 189
abstract Shop getShop()

Return Value

Shop

at line line 194
abstract setVariantMode($variantMode)

Parameters

$variantMode

at line line 199
abstract string getVariantMode()

Return Value

string

at line line 206
abstract Product[] load()

loads search results from index and returns them.

Return Value

Product[]

at line line 219
abstract array getGroupByValues($fieldName, bool $countValues = false, bool $fieldNameShouldBeExcluded = true)

loads group by values based on fieldname either from local variable if prepared or directly from product index.

Parameters

$fieldName
bool $countValues
bool $fieldNameShouldBeExcluded => set to false for and-conditions

Return Value

array

Exceptions

Exception

at line line 232
abstract array getGroupByRelationValues($fieldName, bool $countValues = false, bool $fieldNameShouldBeExcluded = true)

loads group by values based on relation fieldname either from local variable if prepared or directly from product index.

Parameters

$fieldName
bool $countValues
bool $fieldNameShouldBeExcluded => set to false for and-conditions

Return Value

array

Exceptions

Exception

at line line 245
abstract array getGroupBySystemValues($fieldName, bool $countValues = false, bool $fieldNameShouldBeExcluded = true)

loads group by values based on relation fieldname either from local variable if prepared or directly from product index.

Parameters

$fieldName
bool $countValues
bool $fieldNameShouldBeExcluded => set to false for and-conditions

Return Value

array

Exceptions

Exception

at line line 256
abstract Product[] buildSimilarityOrderBy($fields, $objectId)

returns order by statement for similarity calculations based on given fields and object ids returns cosine similarity calculation

Parameters

$fields
$objectId

Return Value

Product[]

at line line 261
Index|null getIndex()

Return Value

Index|null

at line line 269
setIndex( Index|null $index)

Parameters

Index|null $index

at line line 277
string getLocale()

Return Value

string

at line line 302
setLocale( string $locale)

Parameters

string $locale