ProductAttributeRepositoryReader

Implements \ProductAttributeRepositoryReaderInterface

Class ProductAttributeRepositoryReader

category

System

package

ProductModule

subpackage

Reader

Methods

Initialize the product attribute repository reader.

__construct(\CI_DB_query_builder $db, \ProductAttributeFactoryInterface $factory) 

Arguments

$db

\CI_DB_query_builder

Call the setter of the stored product attribute entity.

_callStoredProductAttributeSetter(\StoredProductAttributeInterface $storedProductAttribute, array $data) : \ProductAttributeRepositoryReader|$this
Throws
\InvalidArgumentException

IF the provided product attribute is not valid.

Arguments

$storedProductAttribute

\StoredProductAttributeInterface

$data

array

Response

\ProductAttributeRepositoryReader|$this

Same instance for chained method calls.

Returns a product attribute entity by the given product attribute id.

getAttributeById(\IdType $productAttributeId) : \StoredProductAttributeInterface
Throws
\UnexpectedValueException

If the requested product attribute was not found.

\InvalidArgumentException

If the provided attribute ID is not valid.

Arguments

$productAttributeId

\IdType

Id of expected product attribute entity.

Response

\StoredProductAttributeInterface

Expected product attribute entity.

Returns a collection with all product attribute entities which belongs to the product entity by the given product id.

getAttributesByProductId(\IdType $productId) : \StoredProductAttributeCollection
Throws
\UnexpectedValueException

If the requested attributes were not found.

\InvalidArgumentException

If the provided product ID ist not valid.

Arguments

$productId

\IdType

Id of product entity which belongs to the expected product attribute entities.

Response

\StoredProductAttributeCollection

Collection which contains all expected product attribute entities.

Properties

db

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder

factory

factory : \ProductAttributeFactoryInterface