Class ProductAttributeService

Class ProductAttributeService

ProductAttributeService implements ProductAttributeServiceInterface

Methods summary

public __construct( ProductAttributeRepositoryInterface $productAttributeRepo )

Initialize the product attribute service.

public addAttribute( IdType $productId, ProductAttributeInterface $attribute ) : integer

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

public updateAttribute( StoredProductAttributeInterface $attribute ) :

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 removeAttributeById( IdType $productAttributeId ) : ProductAttributeService|ProductAttributeService

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

public removeAttributesByProductId( IdType $productId ) : ProductAttributeService|ProductAttributeService

Removes product attributes by the given product id.

Properties summary