ProductAttributeRepositoryInterface
in
Interface ProductAttributeRepositoryInterface
Tags
Table of Contents
- addToProduct() : int
- Adds an product attribute to a product by the given id.
- deleteAttributeById() : ProductAttributeRepositoryInterface|$this
- Removes a product attribute entity by the given product attribute id.
- deleteAttributesByProductId() : ProductAttributeRepositoryInterface|$this
- Removes product attributes by the given product id.
- getAttributeById() : StoredProductAttributeInterface
- Returns a stored product attribute entity by the given product attribute id.
- getAttributesByProductId() : StoredProductAttributeCollection
- Returns a collection with all attribute entities that belongs to a product entity by the given product id.
- store() : ProductAttributeRepositoryInterface|$this
- Stores/Updates the passed product attribute entity.
Methods
addToProduct()
Adds an product attribute to a product by the given id.
public
addToProduct(IdType $productId, ProductAttributeInterface $productAttribute) : int
Parameters
- $productId : IdType
-
Id of product entity that adds the attribute.
- $productAttribute : ProductAttributeInterface
-
Product attribute entity to add.
Return values
int —Id of added product attribute entity.
deleteAttributeById()
Removes a product attribute entity by the given product attribute id.
public
deleteAttributeById(IdType $productAttributeId) : ProductAttributeRepositoryInterface|$this
Parameters
- $productAttributeId : IdType
-
Id of product attribute entity that should be deleted.
Return values
ProductAttributeRepositoryInterface|$this —Same instance for chained method calls.
deleteAttributesByProductId()
Removes product attributes by the given product id.
public
deleteAttributesByProductId(IdType $productId) : ProductAttributeRepositoryInterface|$this
Parameters
- $productId : IdType
-
Id of product entity of the attributes that should be deleted.
Return values
ProductAttributeRepositoryInterface|$this —Same instance for chained method calls.
getAttributeById()
Returns a stored product attribute entity by the given product attribute id.
public
getAttributeById(IdType $productAttributeId) : StoredProductAttributeInterface
Parameters
- $productAttributeId : IdType
-
Id of expected product attribute entity.
Return values
StoredProductAttributeInterface —Expected stored product attribute entity.
getAttributesByProductId()
Returns a collection with all attribute entities that belongs to a product entity by the given product id.
public
getAttributesByProductId(IdType $productId) : StoredProductAttributeCollection
Parameters
- $productId : IdType
-
Id of product entity that contain the expected attributes.
Return values
StoredProductAttributeCollection —Collection with all attributes that belongs to the product.
store()
Stores/Updates the passed product attribute entity.
public
store(StoredProductAttributeInterface $productAttribute) : ProductAttributeRepositoryInterface|$this
Parameters
- $productAttribute : StoredProductAttributeInterface
-
Product attribute entity to store.
Return values
ProductAttributeRepositoryInterface|$this —Same instance for chained method calls.