Class CategoryRepositoryReader

Class CategoryRepositoryReader

This class provides methods for fetching specific category records from the database and is used in the category repository among the classes for writing and deleting category records.

CategoryRepositoryReader implements CategoryRepositoryReaderInterface

Methods summary

public __construct( CI_DB_query_builder $db, CategoryFactoryInterface $categoryFactory )

CategoryRepositoryReader constructor.

public getById( IdType $categoryId ) : StoredCategoryInterface

Returns a category.

public getByParentId( IdType $parentId ) : IdCollection

Returns all Categories with the provided parent ID.

public getCategoryIdsTree( IdType $parentCategoryId ) : IdCollection

Returns an id collection with the ids of subcategories.

protected _getCategoryIdsTreeArray( IdType $parentCategoryId ) : array

Fetches the ids of the subcategories from the passed parent category.

protected _createCategoryByArray( array $categoryData, array $categoryDescriptionData ) : StoredCategory

Creates a category instance.

Properties summary

protected $db : CI_DB_query_builder

Database connector.


		
protected $categoryFactory : CategoryFactoryInterface

Category factory.