ProductRepositoryReader
in package
implements
ProductRepositoryReaderInterface
Class ProductRepositoryReader
Tags
Interfaces, Classes and Traits
- ProductRepositoryReaderInterface
- Interface ProductRepositoryReaderInterface
Table of Contents
- $customerStatusProvider : CustomerStatusProviderInterface
- Customer Status Provider
- $db : CI_DB_query_builder
- DB Connection.
- $productFactory : ProductFactory
- Product Factory
- __construct() : mixed
- ProductRepositoryReader constructor.
- countImageUsage() : int
- getById() : StoredProductInterface
- Returns a product entity instance by the given product id.
- getProductsCount() : int
- Returns the count of all product entries.
- _createProductByArray() : StoredProduct
- Create Product by Array
Properties
$customerStatusProvider
Customer Status Provider
protected
CustomerStatusProviderInterface
$customerStatusProvider
$db
DB Connection.
protected
CI_DB_query_builder
$db
$productFactory
Product Factory
protected
ProductFactory
$productFactory
Methods
__construct()
ProductRepositoryReader constructor.
public
__construct(CI_DB_query_builder $db, ProductFactoryInterface $productFactory, CustomerStatusProviderInterface $customerStatusProvider) : mixed
Parameters
- $db : CI_DB_query_builder
- $productFactory : ProductFactoryInterface
- $customerStatusProvider : CustomerStatusProviderInterface
Return values
mixed —countImageUsage()
public
countImageUsage(string $productImagePath) : int
Parameters
- $productImagePath : string
Tags
Return values
int —getById()
Returns a product entity instance by the given product id.
public
getById(IdType $productId) : StoredProductInterface
Parameters
- $productId : IdType
-
Id of product entity.
Tags
Return values
StoredProductInterface —Product entity with the expected product id.
getProductsCount()
Returns the count of all product entries.
public
getProductsCount() : int
Return values
int —_createProductByArray()
Create Product by Array
protected
_createProductByArray(array<string|int, mixed> $product, array<string|int, mixed> $productDescription) : StoredProduct
Creates and returns a StoredProduct.
Parameters
- $product : array<string|int, mixed>
-
Product query result.
- $productDescription : array<string|int, mixed>
-
Product description query result.
Tags
Return values
StoredProduct —StoredProduct object.