ProductReadService

Implements \ProductReadServiceInterface

Class ProductReadService

category

System

package

Product

Methods

ProductReadService constructor.

__construct(\ProductRepositoryInterface $productRepo, \ProductListProviderFactoryInterface $listProviderFactory, \ProductCategoryLinkerInterface $productLinker, \UrlRewriteStorage $urlRewriteStorage) 

Arguments

$urlRewriteStorage

\UrlRewriteStorage

Returns a single UrlRewrite instance for the provided content ID and language ID or NULL if no entry was found.

findRewriteUrl(\IdType $productId, \IdType $languageId) : null|\UrlRewrite

Arguments

$productId

\IdType

$languageId

\IdType

Response

null|\UrlRewrite

Returns an UrlRewriteCollection with UrlRewrite instances for the provided rewrite url.

findUrlRewritesByRewriteUrl(\NonEmptyStringType $rewriteUrl) : \UrlRewriteCollection

Arguments

$rewriteUrl

\NonEmptyStringType

Response

\UrlRewriteCollection

Get Active Product List

getActiveProductList(\LanguageCode $languageCode, \IdType|null $categoryId = null, \IdType|null $customerStatusLimit = null) : \ProductListItemCollection

Returns an active products list.

Arguments

$languageCode

\LanguageCode

The language code.

$categoryId

\IdType|null

The category ID of the product list.

$customerStatusLimit

\IdType|null

The customers status limit.

Response

\ProductListItemCollection

Returns a paged product list.

getPagedList(\LanguageCode $languageCode, \IntType|null $page = null, \IntType|null $limit = null) : \ProductListItemCollection

Arguments

$languageCode

\LanguageCode

Language of location specific data.

$page

\IntType|null

(Optional) Page of product item list.

$limit

\IntType|null

(Optional) Maximal amount of processed elements.

Response

\ProductListItemCollection

Get Product by ID

getProductById(\IdType $productId) : \StoredProductInterface

Returns a specific product, depending on the provided ID.

Arguments

$productId

\IdType

The ID of the product to return.

Response

\StoredProductInterface

The stored product.

Get Product List

getProductList(\LanguageCode $languageCode, \IdType|null $categoryId = null, \IdType|null $customerStatusLimit = null) : \ProductListItemCollection

Returns a specific product list.

Arguments

$languageCode

\LanguageCode

The language code.

$categoryId

\IdType|null

The category ID of the product list.

$customerStatusLimit

\IdType|null

The customers status limit.

Response

\ProductListItemCollection

Returns the count of all product entries.

getProductsCount() : integer

Response

integer

Returns an UrlRewriteCollection with UrlRewrite instances for the provided content ID.

getRewriteUrls(\IdType $productId) : \UrlRewriteCollection

Arguments

$productId

\IdType

Response

\UrlRewriteCollection

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

searchProducts(\LanguageCode $languageCode, \ProductSearchCondition $condition, \Pager $pager) : \ProductListItemCollection

Arguments

$languageCode

\LanguageCode

Language code which should be used for products descriptions etc.

$condition

\ProductSearchCondition

Conditions object for search.

$pager

\Pager

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

Response

\ProductListItemCollection

Properties

productRepo

productRepo : \ProductRepositoryInterface

listProviderFactory

listProviderFactory : \ProductListProviderFactoryInterface

The product category linker.

productLinker : \ProductCategoryLinkerInterface

The url rewrite storage.

urlRewriteStorage : \UrlRewriteStorage
var

Type(s)

\UrlRewriteStorage