CategoryRepositoryInterface

Extends

Interface CategoryRepositoryInterface

This interface defines methods for handling 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

Interfaces

Methods

Adds a category.

add(\CategoryInterface $category) : integer

Arguments

$category

\CategoryInterface

Category to add.

Response

integer

Stored id of the passed category.

Deletes a category by the given ID.

deleteCategoryById(\IdType $categoryId) : \CategoryRepositoryInterface

Arguments

$categoryId

\IdType

Category ID.

Response

\CategoryRepositoryInterface

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) : \CategoryRepositoryInterface

Arguments

$category

\StoredCategoryInterface

Stored category.

Response

\CategoryRepositoryInterface

Same instance for chained method calls.