Class ProductAttributeRepository

Class ProductAttributeRepository

ProductAttributeRepository implements ProductAttributeRepositoryInterface

Methods summary

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

Initialize the product attribute repository.

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

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

public store( StoredProductAttributeInterface $productAttribute ) : ProductAttributeRepository|ProductAttributeRepository

Stores/Updates the passed product attribute entity.

public getAttributeById( IdType $productAttributeId ) : StoredProductAttributeInterface

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

public getAttributesByProductId( IdType $productId ) : StoredProductAttributeCollection

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

public deleteAttributeById( IdType $productAttributeId ) : ProductAttributeRepository|ProductAttributeRepository

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

public deleteAttributesByProductId( IdType $productId ) : ProductAttributeRepository|ProductAttributeRepository

Removes product attributes by the given product id.

Properties summary