ProductListProvider

Extends \AbstractDataPaginator Implements \ProductListProviderInterface

Class ProductListProvider

category

System

package

Product

subpackage

Providers

Methods

ManufacturerReader constructor.

__construct(\CI_DB_query_builder $query_builder) 
inherited

Arguments

$query_builder

\CI_DB_query_builder

Applies the class default sorting

_applyDefaultSorting() 
inherited abstract

Apply extra query conditions.

_applyExtraConditions() : \ProductListProvider

Response

\ProductListProvider

Same instance for chained method calls.

Applies a pagination (Limit and Offset) clause to the currently building query.

_applyPagination(\Pager|null $pager = null) : $this|\ProductListProvider
inherited

Arguments

$pager

\Pager|null

(Optional) Pager object with pagination information

Response

$this|\ProductListProvider

Same instance for chained method calls.

Applies a sorting based on sorter param (if sorting is supplied) or apply default sorting.

_applySorting(array $sorters = array()) : $this|\ProductListProvider
inherited
Throws
\InvalidArgumentException

if some element of the $sorters array is not a instance of Sorter object

Arguments

$sorters

array

Array of Sorter objects.

Response

$this|\ProductListProvider

Same instance for chained method calls.

return the child class Field Map array.

_getFieldMap() : \array.
inherited abstract

Response

\array.

Parse an order by sql query into a array with fieldname and direction.

_parseOrderByString(\StringType|null $orderBy = null) : array
inherited

Arguments

$orderBy

\StringType|null

SQL order by String

Response

array

with sort information structured as ['field'=>'', 'direction'=>''].

Prepares the ProductListItemCollection object.

_prepareCollection(array $result) : \ProductListItemCollection
Throws
\InvalidArgumentException

if the provided result is not valid.

Arguments

$result

array

Query result.

Response

\ProductListItemCollection

Build the select part of the query build.

_select() : \ProductListProvider

Response

\ProductListProvider

Same instance for chained method calls.

Build the select part of the query build and additionally join the products_to_categories table.

_selectWithCategories() : \ProductListProvider

Response

\ProductListProvider

Same instance for chained method calls.

Translate an order by sql instruction into a array of Sorter

_translateOrderByStringIntoArrayOfSorter(\StringType|null $orderBy = null) : array
inherited

Arguments

$orderBy

\StringType|null

SQL instruction with fields to sort.

Response

array

of Sorter objects.

Return the related database field of a given object(Entity) field.

_translateToDatabaseField(\string $fieldName) : \string.
inherited
Throws
\InvalidArgumentException

if the provided field name is not a valid mapped field

Arguments

$fieldName

\string

Object Field name.

Response

\string.

Parse an order by sql query into a array with fieldname and direction.

_translateToJsonFieldName(\StringType $databaseFieldName) : string|FALSE
inherited

Arguments

$databaseFieldName

\StringType

the database field name. It can be supplied as table.fieldName or fieldName.

Response

string|FALSE

will return the field name or FALSE if the field doesn't exist.

Get all product list items.

getAll() : \ProductListItemCollection

Returns a paged list of product items.

getAllPaged(\Pager|null $pager = null, array $sorters = array()) : \ProductListItemCollection

Arguments

$pager

\Pager|null

(Optional) Pager object with pagination information

$sorters

array

(Optional) array of Sorter objects with data sorting information

Response

\ProductListItemCollection

Returns a product list item collection by the provided category ID.

getByCategoryId(\IdType $categoryId) : \ProductListItemCollection
Throws
\InvalidArgumentException

if the provided category ID is not valid.

Arguments

$categoryId

\IdType

Category ID.

Response

\ProductListItemCollection

Filters products records by a given ProductSearchCondition object and returns an collection with results.

searchProducts(\ProductSearchCondition $condition, \Pager|null $pager = null, array $sorters = array()) : \ProductListItemCollection

Arguments

$condition

\ProductSearchCondition

Conditions object for search.

$pager

\Pager|null

(Optional) Pager object with pagination information

$sorters

array

(Optional) array of Sorter objects with data sorting information

Response

\ProductListItemCollection

Count the total of filtered products.

searchProductsCount(\ProductSearchCondition $condition) : \IntType

Arguments

$condition

\ProductSearchCondition

Conditions object for search.

Response

\IntType

Properties

Maps the entity Fields with the database fields

fieldMap : 
static
var

Type(s)

Two-letter language code.

languageCode : \LanguageCode
var

Type(s)

\LanguageCode

Database query conditions.

conditions : array
var

Type(s)

array

Product repository.

productRepository : \ProductRepositoryInterface

db

db : \\CI_DB_query_builder
inherited
var

Type(s)

\\CI_DB_query_builder