ProductRepositoryReader

Implements \ProductRepositoryReaderInterface

Class ProductRepositoryReader

category

System

package

Product

subpackage

Repositories

Methods

ProductRepositoryReader constructor.

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

Arguments

$db

\CI_DB_query_builder

$productFactory

\ProductFactoryInterface

$customerStatusProvider

\CustomerStatusProviderInterface

Create Product by Array

_createProductByArray(array $product, array $productDescription) : \StoredProduct

Creates and returns a StoredProduct.

Throws
\UnexpectedValueException
\InvalidArgumentException

Arguments

$product

array

Product query result.

$productDescription

array

Product description query result.

Response

\StoredProduct

StoredProduct object.

Returns a product entity instance by the given product id.

getById(\IdType $productId) : \StoredProductInterface
Throws
\InvalidArgumentException
\UnexpectedValueException

Arguments

$productId

\IdType

Id of product entity.

Response

\StoredProductInterface

Product entity with the expected product id.

Returns the count of all product entries.

getProductsCount() : integer

Response

integer

Properties

DB Connection.

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder

Product Factory

productFactory : \ProductFactory
var

Type(s)

\ProductFactory

Customer Status Provider

customerStatusProvider : \CustomerStatusProviderInterface