CategoryRepository

Implements \CategoryRepositoryInterface

Class CategoryRepository

This class handles the database operations that concern the category records of the database. It provides a layer for more complicated methods that use the writer, reader and deleter.

category

System

package

Category

subpackage

Repositories

Methods

Initialize the category repository.

__construct(\CategoryRepositoryReaderInterface $reader, \CategoryRepositoryWriterInterface $writer, \CategoryRepositoryDeleterInterface $deleter, \CategorySettingsRepositoryInterface $settingsRepo, \AddonValueServiceInterface $addonValueService, \CustomerStatusProviderInterface $customerStatusProvider, \UrlRewriteStorage $urlRewriteStorage, \DeleteHistoryWriteServiceInterface $deleteHistoryWriteService) 

Arguments

$reader

\CategoryRepositoryReaderInterface

Reader instance to fetch category data from the storage.

$writer

\CategoryRepositoryWriterInterface

Writer instance to store or add category data in the storage.

$deleter

\CategoryRepositoryDeleterInterface

Deleter instance to remove category data from the storage.

$settingsRepo

\CategorySettingsRepositoryInterface

Category setting repository to save/add/remove category settings in the storage.

$addonValueService

\AddonValueServiceInterface

Addon value service instance to handle the category addon values.

$customerStatusProvider

\CustomerStatusProviderInterface

Customer status provider to handle group permissions

$urlRewriteStorage

\UrlRewriteStorage

Url rewrite storage.

$deleteHistoryWriteService

\DeleteHistoryWriteServiceInterface

Adds a category.

add(\CategoryInterface $category) : integer

Arguments

$category

\CategoryInterface

Category.

Response

integer

Stored ID of the passed category.

Deletes a category by the given ID.

deleteCategoryById(\IdType $categoryId) : \CategoryRepository

Arguments

$categoryId

\IdType

Category ID.

Response

\CategoryRepository

Same instance for chained method calls.

Gets a category by the given ID.

getCategoryById(\IdType $categoryId) : \StoredCategoryInterface

Arguments

$categoryId

\IdType

Category ID.

Response

\StoredCategoryInterface

Returns all Categories with the provided parent ID.

getCategoryIdsByParentId(\IdType $parentId) : \IdCollection

Arguments

$parentId

\IdType

Response

\IdCollection

Returns an id collection with the ids of subcategories.

getCategoryIdsTree(\IdType $parentCategoryId) : \IdCollection

Arguments

$parentCategoryId

\IdType

Parent category id.

Response

\IdCollection

Stores a category.

store(\StoredCategoryInterface $category) : \CategoryRepository

Arguments

$category

\StoredCategoryInterface

Category.

Response

\CategoryRepository

Same instance for chained method calls.

Properties

Category repository reader.

reader : \CategoryRepositoryReaderInterface

Category repository writer.

writer : \CategoryRepositoryWriterInterface

Category repository deleter.

deleter : \CategoryRepositoryDeleterInterface

Category settings repository.

settingsRepo : \CategorySettingsRepositoryInterface

Addon value service.

addonValueService : \AddonValueServiceInterface

Customer Status Provider

customerStatusProvider : \CustomerStatusProviderInterface

urlRewriteStorage

urlRewriteStorage : \UrlRewriteStorage
var

Type(s)

\UrlRewriteStorage

deleteHistoryWriteService

deleteHistoryWriteService : \DeleteHistoryWriteServiceInterface