CategoryReadService

Implements \CategoryReadServiceInterface

Class CategoryReadService

This class provides methods for retrieving data of a particular category and a collection of specific categories.

category

System

package

Category

Methods

CategoryReadService constructor.

__construct(\CategoryRepositoryInterface $categoryRepo, \CategoryListProviderFactoryInterface $categoryListProviderFactory, \UrlRewriteStorage $urlRewriteStorage) 

Arguments

$categoryRepo

\CategoryRepositoryInterface

Category repository.

$categoryListProviderFactory

\CategoryListProviderFactoryInterface

Category list provider.

$urlRewriteStorage

\UrlRewriteStorage

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

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

Arguments

$categoryId

\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

Returns CategoryListItemCollection of active categories.

getActiveCategoryList(\LanguageCode $languageCode, \IdType|null $parentId = null, \IdType|null $customerStatusLimit = null) : \CategoryListItemCollection

Arguments

$languageCode

\LanguageCode

The language code for the wanted language.

$parentId

\IdType|null

The parent ID of the categories.

$customerStatusLimit

\IdType|null

Customer status ID to decide the allowance.

Response

\CategoryListItemCollection

Returns a StoredCategory object with the provided category ID.

getCategoryById(\IdType $categoryId) : \StoredCategoryInterface

Arguments

$categoryId

\IdType

ID of the category.

Response

\StoredCategoryInterface

Returns an id collection with the ids of subcategories.

getCategoryIdsTree(\IdType $parentCategoryId) : \IdCollection

Arguments

$parentCategoryId

\IdType

Parent category id.

Response

\IdCollection

Returns a CategoryListItemCollection.

getCategoryList(\LanguageCode $languageCode, \IdType|null $parentId = null, \IdType|null $customerStatusLimit = null) : \CategoryListItemCollection

Arguments

$languageCode

\LanguageCode

The language code for the wanted language.

$parentId

\IdType|null

The parent ID of the categories.

$customerStatusLimit

\IdType|null

Customer status ID to decide the allowance.

Response

\CategoryListItemCollection

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

getRewriteUrls(\IdType $categoryId) : \UrlRewriteCollection

Arguments

$categoryId

\IdType

Response

\UrlRewriteCollection

Filters category records by a given CategorySearchCondition object and returns an collection with results.

searchCategories(\LanguageCode $languageCode, \CategorySearchCondition $condition, \Pager $pager) : \CategoryListItemCollection

Arguments

$languageCode

\LanguageCode

Language code that is used for category descriptions etc.

$condition

\CategorySearchCondition

Conditions object for search.

$pager

\Pager

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

Response

\CategoryListItemCollection

Properties

Category repository interface.

categoryRepo : \CategoryRepositoryInterface

Category list provider factory.

categoryListProviderFactory : \CategoryListProviderFactoryInterface

The url rewrite storage.

urlRewriteStorage : \UrlRewriteStorage
var

Type(s)

\UrlRewriteStorage