phpDocumentor

ProductAttributeRepositoryReader
in package
implements ProductAttributeRepositoryReaderInterface

Class ProductAttributeRepositoryReader

Tags
category

System

subpackage

Reader

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

Methods

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

If the provided attribute ID is not valid.

throws
UnexpectedValueException

If the requested product attribute was not found.

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

If the provided product ID ist not valid.

throws
UnexpectedValueException

If the requested attributes were not found.

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

IF the provided product attribute is not valid.

Return values
ProductAttributeRepositoryReader|$this

Same instance for chained method calls.

Search results