CategoryRepositoryReader

Implements \CategoryRepositoryReaderInterface

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.

category

System

package

Category

subpackage

Repositories

Methods

CategoryRepositoryReader constructor.

__construct(\CI_DB_query_builder $db, \CategoryFactoryInterface $categoryFactory) 

Arguments

$db

\CI_DB_query_builder

Database connector.

$categoryFactory

\CategoryFactoryInterface

Category factory.

Creates a category instance.

_createCategoryByArray(array $categoryData, array $categoryDescriptionData) : \StoredCategory
throws

Arguments

$categoryData

array

Category query result.

$categoryDescriptionData

array

Category description query result.

Response

\StoredCategory

Returns the complete category object.

Returns a category.

getById(\IdType $categoryId) : \StoredCategoryInterface
throws

if no category record for the provided category ID was found.

Arguments

$categoryId

\IdType

Category ID.

Response

\StoredCategoryInterface

Returns all Categories with the provided parent ID.

getByParentId(\IdType $parentId) : \IdCollection

Arguments

$parentId

\IdType

Response

\IdCollection

Properties

Database connector.

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder

Category factory.

categoryFactory : \CategoryFactoryInterface