CategorySettingsRepositoryReader

Implements \CategorySettingsRepositoryReaderInterface

Class CategorySettingsRepositoryReader

This class provides methods for fetching particular columns of specific category records in the database. The category settings are stored in the categories table and are more related to display and visibility modes of category related data.

category

System

package

Category

subpackage

Repositories

Methods

CategorySettingsRepositoryReader constructor.

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

Arguments

$db

\CI_DB_query_builder

Database connector.

$categoryFactory

\CategoryFactoryInterface

Category factory.

$customerStatusProvider

\CustomerStatusProviderInterface

Customer Status Provider.

Creates a CategorySettings object and returns it.

_createAndReturnCategorySettings(array $category) : \CategorySettings
Throws
\UnexpectedValueException
\InvalidArgumentException

Arguments

$category

array

Fetched Associative category array.

Response

\CategorySettings

$categorySettings

Sets the permitted customers statuses.

_setGroupPermissions(array $category, array $groupPermissionIds, \CategorySettings $categorySettings) : \CategorySettingsRepositoryReader
Throws
\InvalidArgumentException

Arguments

$category

array

The fetched category array from the database.

$groupPermissionIds

array

Array of available group permission.

$categorySettings

\CategorySettings

Object to set the customer statuses.

Response

\CategorySettingsRepositoryReader

Same instance for chained method calls.

Returns category settings based on ID given.

getById(\IdType $categoryId) : \CategorySettingsInterface
Throws
\InvalidArgumentException
\UnexpectedValueException

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

Arguments

$categoryId

\IdType

Category ID.

Response

\CategorySettingsInterface

Properties

Database Connection

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder

Category factory

categoryFactory : \CategoryFactoryInterface

Customer Status Provider

customerStatusProvider : \CustomerStatusProviderInterface