phpDocumentor

ProductReadService
in package
implements ProductReadServiceInterface

Class ProductReadService

Tags
category

System

Interfaces, Classes and Traits

ProductReadServiceInterface
Interface ProductReadServiceInterface

Table of Contents

$listProviderFactory  : ProductListProviderFactoryInterface
$productLinker  : ProductCategoryLinkerInterface
The product category linker.
$productRepo  : ProductRepositoryInterface
$urlRewriteStorage  : UrlRewriteStorage
The url rewrite storage.
__construct()  : mixed
ProductReadService constructor.
findRewriteUrl()  : null|UrlRewrite
Returns a single UrlRewrite instance for the provided content ID and language ID or NULL if no entry was found.
findUrlRewritesByRewriteUrl()  : UrlRewriteCollection
Returns an UrlRewriteCollection with UrlRewrite instances for the provided rewrite url.
getActiveProductList()  : ProductListItemCollection
Get Active Product List
getPagedList()  : ProductListItemCollection
Returns a paged product list.
getProductById()  : StoredProductInterface
Get Product by ID
getProductLinks()  : IdCollection
Returns the category Ids which are linked with given product id.
getProductList()  : ProductListItemCollection
Get Product List
getProductsCount()  : int
Returns the count of all product entries.
getRewriteUrls()  : UrlRewriteCollection
Returns an UrlRewriteCollection with UrlRewrite instances for the provided content ID.
searchProducts()  : ProductListItemCollection
Filters products records by a given ProductSearchCondition object and returns an array with results.
searchProductsCount()  : IntType
Count the total of filtered products.

Properties

Methods

__construct()

ProductReadService constructor.

public __construct(ProductRepositoryInterface $productRepo, ProductListProviderFactoryInterface $listProviderFactory, ProductCategoryLinkerInterface $productLinker, UrlRewriteStorage $urlRewriteStorage) : mixed
Parameters
$productRepo : ProductRepositoryInterface
$listProviderFactory : ProductListProviderFactoryInterface
$productLinker : ProductCategoryLinkerInterface
$urlRewriteStorage : UrlRewriteStorage
Return values
mixed

getActiveProductList()

Get Active Product List

public getActiveProductList(LanguageCode $languageCode[, IdType|null $categoryId = null ][, IdType|null $customerStatusLimit = null ]) : ProductListItemCollection

Returns an active products list.

Parameters
$languageCode : LanguageCode

The language code.

$categoryId : IdType|null = null

The category ID of the product list.

$customerStatusLimit : IdType|null = null

The customers status limit.

Return values
ProductListItemCollection

getPagedList()

Returns a paged product list.

public getPagedList(LanguageCode $languageCode[, Pager|null $pager = null ][, array<string|int, mixed> $sorters = [] ]) : ProductListItemCollection
Parameters
$languageCode : LanguageCode

Language of location specific data.

$pager : Pager|null = null

(Optional) Pager object with pagination information

$sorters : array<string|int, mixed> = []

(Optional) array of Sorter objects with data sorting information

Return values
ProductListItemCollection

getProductList()

Get Product List

public getProductList(LanguageCode $languageCode[, IdType|null $categoryId = null ][, IdType|null $customerStatusLimit = null ]) : ProductListItemCollection

Returns a specific product list.

Parameters
$languageCode : LanguageCode

The language code.

$categoryId : IdType|null = null

The category ID of the product list.

$customerStatusLimit : IdType|null = null

The customers status limit.

Return values
ProductListItemCollection

getProductsCount()

Returns the count of all product entries.

public getProductsCount() : int
Return values
int

searchProducts()

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

public searchProducts(LanguageCode $languageCode, ProductSearchCondition $condition[, Pager|null $pager = null ][, array<string|int, mixed> $sorters = [] ]) : ProductListItemCollection
Parameters
$languageCode : LanguageCode

Language code which should be used for products descriptions etc.

$condition : ProductSearchCondition

Conditions object for search.

$pager : Pager|null = null

(Optional) Pager object with pagination information

$sorters : array<string|int, mixed> = []

(Optional) array of Sorter objects with data sorting information

Return values
ProductListItemCollection

Search results