Class CategoryRepository

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.

CategoryRepository implements CategoryRepositoryInterface

Methods summary

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

Initialize the category repository.

public add( CategoryInterface $category ) : integer

Adds a category.

public store( StoredCategoryInterface $category ) : CategoryRepository

Stores a category.

public getCategoryById( IdType $categoryId ) : StoredCategoryInterface

Gets a category by the given ID.

public getCategoryIdsByParentId( IdType $parentId ) : IdCollection

Returns all Categories with the provided parent ID.

public deleteCategoryById( IdType $categoryId ) : CategoryRepository

Deletes a category by the given ID.

public getCategoryIdsTree( IdType $parentCategoryId ) : IdCollection

Returns an id collection with the ids of subcategories.

Properties summary

protected $reader : CategoryRepositoryReaderInterface

Category repository reader.


		
protected $writer : CategoryRepositoryWriterInterface

Category repository writer.


		
protected $deleter : CategoryRepositoryDeleterInterface

Category repository deleter.


		
protected $settingsRepo : CategorySettingsRepositoryInterface

Category settings repository.


		
protected $addonValueService : AddonValueServiceInterface

Addon value service.


		
protected $customerStatusProvider : CustomerStatusProviderInterface

Customer Status Provider