ProductSettingsRepositoryReader

Implements \ProductSettingsRepositoryReaderInterface

Class ProductSettingsRepositoryReader

category

System

package

Product

subpackage

Repositories

Methods

ProductSettingsRepositoryReader Constructor

__construct(\CI_DB_query_builder $db, \ProductFactoryInterface $productFactory, \CustomerStatusProviderInterface $customerStatusProvider) 

Arguments

$db

\CI_DB_query_builder

Database connection.

$productFactory

\ProductFactoryInterface

Product factory.

$customerStatusProvider

\CustomerStatusProviderInterface

Customer Status Provider.

Creates an empty settings object, gets Data from the database

_createProductByArray(array $data) : \GXEngineProduct
Throws
\InvalidArgumentException

if the provided data argument is not valid.

Arguments

$data

array

Product data.

Response

\GXEngineProduct

Same instance for chained method calls.

Sets the permitted customers statuses.

_setGroupPermissions(array $product, array $groupPermissionIds, \ProductSettingsInterface $productSettings) : \CategorySettingsRepositoryReader

Arguments

$product

array

The fetched product array from the database.

$groupPermissionIds

array

Array of available group permission.

$productSettings

\ProductSettingsInterface

Object to set the customer statuses.

Response

\CategorySettingsRepositoryReader

Same instance for chained method calls.

Returns a product settings instance by the given product id.

getById(\IdType $productId) : \ProductSettingsInterface
Throws
\UnexpectedValueException

if the product was not found by the provided ID.

Arguments

$productId

\IdType

Id of product entity.

Response

\ProductSettingsInterface

Entity with product settings for the expected product id.

Properties

db

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder

productFactory

productFactory : \ProductFactoryInterface

Customer Status Provider

customerStatusProvider : \CustomerStatusProviderInterface