ProductAttributeRepository

Implements \ProductAttributeRepositoryInterface

Class ProductAttributeRepository

category

System

package

ProductModule

subpackage

Repositories

Methods

Initialize the product attribute repository.

__construct(\ProductAttributeRepositoryReaderInterface $reader, \ProductAttributeRepositoryWriterInterface $writer, \ProductAttributeRepositoryDeleterInterface $deleter) 

Adds an product attribute to a product by the given id.

addToProduct(\IdType $productId, \ProductAttributeInterface $productAttribute) : integer

Arguments

$productId

\IdType

Id of product entity that adds the attribute.

$productAttribute

\ProductAttributeInterface

Product attribute entity to add.

Response

integer

Id of added product attribute entity.

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

deleteAttributeById(\IdType $productAttributeId) : \ProductAttributeRepository|$this

Arguments

$productAttributeId

\IdType

Id of product attribute entity that should be deleted.

Response

\ProductAttributeRepository|$this

Same instance for chained method calls.

Removes product attributes by the given product id.

deleteAttributesByProductId(\IdType $productId) : \ProductAttributeRepository|$this

Arguments

$productId

\IdType

Id of product entity of the attributes that should be deleted.

Response

\ProductAttributeRepository|$this

Same instance for chained method calls.

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

getAttributeById(\IdType $productAttributeId) : \StoredProductAttributeInterface

Arguments

$productAttributeId

\IdType

Id of expected product attribute entity.

Response

\StoredProductAttributeInterface

Expected stored product attribute entity.

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

getAttributesByProductId(\IdType $productId) : \StoredProductAttributeCollection

Arguments

$productId

\IdType

Id of product entity that contain the expected attributes.

Response

\StoredProductAttributeCollection

Collection with all attributes that belongs to the product.

Stores/Updates the passed product attribute entity.

store(\StoredProductAttributeInterface $productAttribute) : \ProductAttributeRepository|$this

Arguments

$productAttribute

\StoredProductAttributeInterface

Product attribute entity to store.

Response

\ProductAttributeRepository|$this

Same instance for chained method calls.

Properties

reader

reader : \ProductAttributeRepositoryReaderInterface

writer

writer : \ProductAttributeRepositoryWriterInterface

deleter

deleter : \ProductAttributeRepositoryDeleterInterface