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

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

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

If the provided attribute ID is not valid.

\UnexpectedValueException

If the requested product attribute was not found.

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
\InvalidArgumentException

If the provided product ID ist not valid.

\UnexpectedValueException

If the requested attributes were not found.

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