ProductListProvider

Implements \ProductListProviderInterface

Class ProductListProvider

category

System

package

Product

subpackage

Providers

Methods

ProductListProvider constructor.

__construct(\LanguageCode $languageCode, array $conditions = array(), \ProductRepositoryInterface $productRepo, \CI_DB_query_builder $db) 

Arguments

$languageCode

\LanguageCode

Two-letter language code.

$conditions

array

Database query conditions.

$productRepo

\ProductRepositoryInterface

Product repository.

$db

\CI_DB_query_builder

Database connection.

Apply extra query conditions.

_applyExtraConditions() : \ProductListProvider

Response

\ProductListProvider

Same instance for chained method calls.

Applies a LIMIT,OFFSET clause to the currently building query.

_applyLimitAndOffset(\IntType|null $page = null, \IntType|null $limit = null) : $this|\ProductListProvider

Arguments

$page

\IntType|null

Page to calculate the given offset.

$limit

\IntType|null

Limit of result count.

Response

$this|\ProductListProvider

Same instance for chained method calls.

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.

Get all product list items.

getAll() : \ProductListItemCollection

Returns a paged list of product items.

getAllPaged(\IntType|null $page = null, \IntType|null $limit = null) : \ProductListItemCollection

Arguments

$page

\IntType|null

(Optional) Offset of resource elements.

$limit

\IntType|null

(Optional) Maximum amount of elements per page.

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 $pager) : \ProductListItemCollection

Arguments

$condition

\ProductSearchCondition

Conditions object for search.

$pager

\Pager

Pager object with page settings to split the results into several pages.

Response

\ProductListItemCollection

Properties

Two-letter language code.

languageCode : \LanguageCode
var

Type(s)

\LanguageCode

Database query conditions.

conditions : array
var

Type(s)

array

Product repository.

productRepository : \ProductRepositoryInterface

Database connection.

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder