phpDocumentor

CategoryRepositoryReader
in package
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.

Tags
category

System

subpackage

Repositories

Interfaces, Classes and Traits

CategoryRepositoryReaderInterface
Interface CategoryRepositoryReaderInterface

Table of Contents

$categoryFactory  : CategoryFactoryInterface
Category factory.
$db  : CI_DB_query_builder
Database connector.
__construct()  : mixed
CategoryRepositoryReader constructor.
getActiveCategoryIdsTree()  : IdCollection
Returns an id collection with the ids of the active subcategories.
getById()  : StoredCategoryInterface
Returns a category.
getByParentId()  : IdCollection
Returns all Categories with the provided parent ID.
getCategoryIdsTree()  : IdCollection
Returns an id collection with the ids of subcategories.
_createCategoryByArray()  : StoredCategory
Creates a category instance.
_getActiveCategoryIdsTreeArray()  : array<string|int, mixed>
Fetches the ids of the active subcategories from the passed parent category.
_getCategoryIdsTreeArray()  : array<string|int, mixed>
Fetches the ids of the subcategories from the passed parent category.

Properties

Methods

_createCategoryByArray()

Creates a category instance.

protected _createCategoryByArray(array<string|int, mixed> $categoryData, array<string|int, mixed> $categoryDescriptionData) : StoredCategory
Parameters
$categoryData : array<string|int, mixed>

Category query result.

$categoryDescriptionData : array<string|int, mixed>

Category description query result.

Tags
throws
LogicException
throws
InvalidArgumentException
Return values
StoredCategory

Returns the complete category object.

_getActiveCategoryIdsTreeArray()

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

protected _getActiveCategoryIdsTreeArray(IdType $parentCategoryId) : array<string|int, mixed>
Parameters
$parentCategoryId : IdType

Parent id from category of subcategory ids to be fetched.

Return values
array<string|int, mixed>

Contains unsorted ids of sub categories from passed parent category id.

_getCategoryIdsTreeArray()

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

protected _getCategoryIdsTreeArray(IdType $parentCategoryId) : array<string|int, mixed>
Parameters
$parentCategoryId : IdType

Parent id from category of subcategory ids to be fetched.

Return values
array<string|int, mixed>

Contains unsorted ids of sub categories from passed parent category id.

Search results