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.

Prepares the ProductListItemCollection object.

_prepareCollection(array $result) : \ProductListItemCollection
throws

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.

Get all product list items.

getAll() : \ProductListItemCollection

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

getByCategoryId(\IdType $categoryId) : \ProductListItemCollection
throws

if the provided category ID is not valid.

Arguments

$categoryId

\IdType

Category ID.

Response

\ProductListItemCollection

Properties

Two-letter language code.

languageCode : \LanguageCode
var

Type(s)

\LanguageCode

Database query conditions.

conditions : array
var

Type(s)

array

Product repository.

productRepo : \ProductRepositoryInterface

Database connection.

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder