Class CategoryReadService

Class CategoryReadService

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

CategoryReadService implements CategoryReadServiceInterface
Package: Category
Category: System
Located at Services/Core/Category/CategoryReadService.inc.php

Methods summary

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

CategoryReadService constructor.

public getCategoryById( IdType $categoryId ) : StoredCategoryInterface

Returns a StoredCategory object with the provided category ID.

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

Returns a CategoryListItemCollection.

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

Returns CategoryListItemCollection of active categories.

public getRewriteUrls( IdType $categoryId ) : UrlRewriteCollection

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

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

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

public findUrlRewritesByRewriteUrl( NonEmptyStringType $rewriteUrl ) : UrlRewriteCollection

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

public getCategoryIdsTree( IdType $parentCategoryId ) : IdCollection

Returns an id collection with the ids of subcategories.

Properties summary

protected $categoryRepo : CategoryRepositoryInterface

Category repository interface.


		
protected $categoryListProviderFactory : CategoryListProviderFactoryInterface

Category list provider factory.


		
protected $urlRewriteStorage : UrlRewriteStorage

The url rewrite storage.