ProductAttributeRepositoryWriter
in package
implements
ProductAttributeRepositoryWriterInterface
Class ProductAttributeRepositoryWriter
Tags
Interfaces, Classes and Traits
- ProductAttributeRepositoryWriterInterface
- Interface ProductAttributeRepositoryWriterInterface
Table of Contents
- $db : CI_DB_query_builder
- $tableName : string
- __construct() : mixed
- Initialize the product attribute repository writer.
- insertIntoProduct() : int
- Adds a product attribute entity to a product by the given product id.
- update() : ProductAttributeRepositoryWriter|$this
- Updates a product attribute entity.
Properties
$db
protected
CI_DB_query_builder
$db
$tableName
protected
string
$tableName
= 'products_attributes'
Methods
__construct()
Initialize the product attribute repository writer.
public
__construct(CI_DB_query_builder $db) : mixed
Parameters
- $db : CI_DB_query_builder
Return values
mixed —insertIntoProduct()
Adds a product attribute entity to a product by the given product id.
public
insertIntoProduct(IdType $productId, ProductAttributeInterface $productAttribute) : int
Parameters
- $productId : IdType
-
Id of product entity which should belongs to the added attributes.
- $productAttribute : ProductAttributeInterface
-
Product attribute entity to add to the product.
Return values
int —Id of the stored product attribute.
update()
Updates a product attribute entity.
public
update(StoredProductAttributeInterface $productAttribute) : ProductAttributeRepositoryWriter|$this
Parameters
- $productAttribute : StoredProductAttributeInterface
-
Product attribute entity to update.
Return values
ProductAttributeRepositoryWriter|$this —Same instance for chained method calls.