ProductSettingsRepositoryReader
in package
implements
ProductSettingsRepositoryReaderInterface
Class ProductSettingsRepositoryReader
Tags
Interfaces, Classes and Traits
- ProductSettingsRepositoryReaderInterface
- Interface ProductSettingsRepositoryReaderInterface
Table of Contents
- $customerStatusProvider : CustomerStatusProviderInterface
- Customer Status Provider
- $db : CI_DB_query_builder
- $productFactory : ProductFactoryInterface
- __construct() : mixed
- ProductSettingsRepositoryReader Constructor
- getById() : ProductSettingsInterface
- Returns a product settings instance by the given product id.
- _createProductByArray() : GXEngineProduct
- Creates an empty settings object, gets Data from the database
- _setGroupPermissions() : CategorySettingsRepositoryReader
- Sets the permitted customers statuses.
Properties
$customerStatusProvider
Customer Status Provider
protected
CustomerStatusProviderInterface
$customerStatusProvider
$db
protected
CI_DB_query_builder
$db
$productFactory
protected
ProductFactoryInterface
$productFactory
Methods
__construct()
ProductSettingsRepositoryReader Constructor
public
__construct(CI_DB_query_builder $db, ProductFactoryInterface $productFactory, CustomerStatusProviderInterface $customerStatusProvider) : mixed
Parameters
- $db : CI_DB_query_builder
-
Database connection.
- $productFactory : ProductFactoryInterface
-
Product factory.
- $customerStatusProvider : CustomerStatusProviderInterface
-
Customer Status Provider.
Return values
mixed —getById()
Returns a product settings instance by the given product id.
public
getById(IdType $productId) : ProductSettingsInterface
Parameters
- $productId : IdType
-
Id of product entity.
Tags
Return values
ProductSettingsInterface —Entity with product settings for the expected product id.
_createProductByArray()
Creates an empty settings object, gets Data from the database
protected
_createProductByArray(array<string|int, mixed> $data) : GXEngineProduct
Parameters
- $data : array<string|int, mixed>
-
Product data.
Tags
Return values
GXEngineProduct —Same instance for chained method calls.
_setGroupPermissions()
Sets the permitted customers statuses.
protected
_setGroupPermissions(array<string|int, mixed> $product, array<string|int, mixed> $groupPermissionIds, ProductSettingsInterface $productSettings) : CategorySettingsRepositoryReader
Parameters
- $product : array<string|int, mixed>
-
The fetched product array from the database.
- $groupPermissionIds : array<string|int, mixed>
-
Array of available group permission.
- $productSettings : ProductSettingsInterface
-
Object to set the customer statuses.
Return values
CategorySettingsRepositoryReader —Same instance for chained method calls.