ProductAttributeRepositoryReader
in package
implements
ProductAttributeRepositoryReaderInterface
Class ProductAttributeRepositoryReader
Tags
Interfaces, Classes and Traits
- ProductAttributeRepositoryReaderInterface
- Interface ProductAttributeRepositoryReaderInterface
Table of Contents
- $db : CI_DB_query_builder
- $factory : ProductAttributeFactoryInterface
- __construct() : mixed
- Initialize the product attribute repository reader.
- getAttributeById() : StoredProductAttributeInterface
- Returns a product attribute entity by the given product attribute id.
- getAttributesByProductId() : StoredProductAttributeCollection
- Returns a collection with all product attribute entities which belongs to the product entity by the given product id.
- _callStoredProductAttributeSetter() : ProductAttributeRepositoryReader|$this
- Call the setter of the stored product attribute entity.
Properties
$db
private
CI_DB_query_builder
$db
$factory
private
ProductAttributeFactoryInterface
$factory
Methods
__construct()
Initialize the product attribute repository reader.
public
__construct(CI_DB_query_builder $db, ProductAttributeFactoryInterface $factory) : mixed
Parameters
- $db : CI_DB_query_builder
- $factory : ProductAttributeFactoryInterface
Return values
mixed —getAttributeById()
Returns a product attribute entity by the given product attribute id.
public
getAttributeById(IdType $productAttributeId) : StoredProductAttributeInterface
Parameters
- $productAttributeId : IdType
-
Id of expected product attribute entity.
Tags
Return values
StoredProductAttributeInterface —Expected product attribute entity.
getAttributesByProductId()
Returns a collection with all product attribute entities which belongs to the product entity by the given product id.
public
getAttributesByProductId(IdType $productId) : StoredProductAttributeCollection
Parameters
- $productId : IdType
-
Id of product entity which belongs to the expected product attribute entities.
Tags
Return values
StoredProductAttributeCollection —Collection which contains all expected product attribute entities.
_callStoredProductAttributeSetter()
Call the setter of the stored product attribute entity.
protected
_callStoredProductAttributeSetter(StoredProductAttributeInterface $storedProductAttribute, array<string|int, mixed> $data) : ProductAttributeRepositoryReader|$this
Parameters
- $storedProductAttribute : StoredProductAttributeInterface
- $data : array<string|int, mixed>
Tags
Return values
ProductAttributeRepositoryReader|$this —Same instance for chained method calls.