Class ProductListProvider

Class ProductListProvider

ProductListProvider implements ProductListProviderInterface

Methods summary

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

ProductListProvider constructor.

public getByCategoryId( IdType $categoryId ) : ProductListItemCollection

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

public getAll( void ) : ProductListItemCollection

Get all product list items.

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

Returns a paged list of product items.

protected _applyLimitAndOffset( IntType $page = null, IntType $limit = null ) :

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

protected _select( void ) : ProductListProvider

Build the select part of the query build.

protected _selectWithCategories( void ) : ProductListProvider

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

protected _applyExtraConditions( void ) : ProductListProvider

Apply extra query conditions.

protected _prepareCollection( array $result ) : ProductListItemCollection

Prepares the ProductListItemCollection object.

Properties summary

protected $languageCode : LanguageCode

Two-letter language code.


		
protected $conditions : array

Database query conditions.


		
protected $productRepository : ProductRepositoryInterface

Product repository.


		
protected $db : CI_DB_query_builder

Database connection.