class Mysql extends Listing

Class Mysql

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 from Listing

Methods

__construct( Index $index)

Mysql constructor.

getProducts()

No description

addCondition( Condition $condition, string $fieldName)

No description

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)

Add Relation Condition.

resetCondition($fieldName)

Reset conditions.

resetQueryCondition($fieldName)

Reset query condition for fieldname.

resetConditions()

resets all conditions of product list.

setOrder($order)

set Order.

string
getOrder()

get order.

setOrderKey($orderKey)

set Order Key.

string
getOrderKey()

get Order Key.

setLimit($limit)

set limit.

int
getLimit()

get limit.

setOffset($offset)

set offset.

int
getOffset()

get offset.

setCategory( Category $category)

No description

getCategory()

get category.

setShop( Shop $shop)

No description

getShop()

get shop.

setVariantMode($variantMode)

set variant mode.

string
getVariantMode()

get variant mode.

load()

load.

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

get group by values.

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

get group by relation values.

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

from Listing
setIndex( Index|null $index)

No description

from Listing
string
getLocale()

No description

from Listing
setLocale( string $locale)

No description

from Listing
string
getTableName()

return tablename.

string
getQueryTableName()

return query tablename

string
getRelationTablename()

get tablename for relations.

mixed
quote($value)

quote value.

string
getJoins()

get joins.

int
count()

(PHP 5 >= 5.1.0)
Count elements of an object.

mixed
current()

(PHP 5 >= 5.1.0)
Return the current element.

array
getItems( int $offset, int $itemCountPerPage)

Returns an collection of items for a page.

Zend_Paginator_Adapter_Interface
getPaginatorAdapter()

Return a fully configured Paginator Adapter from this method.

mixed
key()

(PHP 5 >= 5.1.0)
Return the key of the current element.

next()

(PHP 5 >= 5.1.0)
Move forward to next element.

rewind()

(PHP 5 >= 5.1.0)
Rewind the Iterator to the first element.

bool
valid()

(PHP 5 >= 5.1.0)
Checks if current position is valid.

Details

at line line 117
__construct( Index $index)

Mysql constructor.

Parameters

Index $index

at line line 128
Product[] getProducts()

Return Value

Product[]

at line line 141
addCondition( Condition $condition, string $fieldName)

Parameters

Condition $condition
string $fieldName

at line line 191
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 164
addRelationCondition( Condition $condition, string $fieldName)

Add Relation Condition.

Parameters

Condition $condition
string $fieldName

at line line 152
resetCondition($fieldName)

Reset conditions.

Parameters

$fieldName

at line line 203
resetQueryCondition($fieldName)

Reset query condition for fieldname.

Parameters

$fieldName

at line line 173
resetConditions()

resets all conditions of product list.

at line line 214
setOrder($order)

set Order.

Parameters

$order

at line line 225
string getOrder()

get order.

Return Value

string

at line line 235
setOrderKey($orderKey)

set 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 252
string getOrderKey()

get Order Key.

Return Value

string | array

at line line 262
setLimit($limit)

set limit.

Parameters

$limit int

at line line 275
int getLimit()

get limit.

Return Value

int

at line line 285
setOffset($offset)

set offset.

Parameters

$offset int

at line line 298
int getOffset()

get offset.

Return Value

int

at line line 306
setCategory( Category $category)

Parameters

Category $category

at line line 317
Category getCategory()

get category.

Return Value

Category

at line line 325
setShop( Shop $shop)

Parameters

Shop $shop

at line line 336
Shop getShop()

get shop.

Return Value

Shop

at line line 346
setVariantMode($variantMode)

set variant mode.

Parameters

$variantMode

at line line 357
string getVariantMode()

get variant mode.

Return Value

string

at line line 369
Product[] load()

load.

Return Value

Product[]

Exceptions

Exception

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

get group by values.

Parameters

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

Return Value

array

Exceptions

Exception

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

get group by relation values.

Parameters

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

Return Value

array

Exceptions

Exception

at line line 452
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 608
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[]

in Listing at line line 261
Index|null getIndex()

Return Value

Index|null

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

Parameters

Index|null $index

in Listing at line line 277
string getLocale()

Return Value

string

in Listing at line line 302
setLocale( string $locale)

Parameters

string $locale

at line line 618
string getTableName()

return tablename.

Return Value

string

at line line 628
string getQueryTableName()

return query tablename

Return Value

string

at line line 638
string getRelationTablename()

get tablename for relations.

Return Value

string

at line line 650
mixed quote($value)

quote value.

Parameters

$value

Return Value

mixed

at line line 660
string getJoins()

get joins.

Return Value

string

at line line 701
int count()

(PHP 5 >= 5.1.0)
Count elements of an object.

Return Value

int The custom count as an integer.

The return value is cast to an integer.

at line line 718
mixed current()

(PHP 5 >= 5.1.0)
Return the current element.

Return Value

mixed Can return any type.

at line line 734
array getItems( int $offset, int $itemCountPerPage)

Returns an collection of items for a page.

Parameters

int $offset Page offset
int $itemCountPerPage Number of items per page

Return Value

array

at line line 747
Zend_Paginator_Adapter_Interface getPaginatorAdapter()

Return a fully configured Paginator Adapter from this method.

Return Value

Zend_Paginator_Adapter_Interface

at line line 761
mixed key()

(PHP 5 >= 5.1.0)
Return the key of the current element.

Return Value

mixed scalar scalar on success, integer 0 on failure.

at line line 775
next()

(PHP 5 >= 5.1.0)
Move forward to next element.

at line line 789
rewind()

(PHP 5 >= 5.1.0)
Rewind the Iterator to the first element.

at line line 804
bool valid()

(PHP 5 >= 5.1.0)
Checks if current position is valid.

Return Value

bool The return value will be casted to boolean and then evaluated. Returns true on success or false on failure.