phpDocumentor

ProductRepositoryWriter
in package
implements ProductRepositoryWriterInterface

Class ProductRepositoryWriter

Tags
category

System

subpackage

Repositories

Interfaces, Classes and Traits

ProductRepositoryWriterInterface
Interface ProductRepositoryWriterInterface

Table of Contents

$db  : CI_DB_query_builder
The database connection.
$languageProvider  : LanguageProviderInterface
Used for fetching the language data.
__construct()  : mixed
ProductRepositoryWriter constructor.
insert()  : int
Insert
update()  : ProductRepositoryWriter
Update
_parseProductData()  : array<string|int, mixed>
Convert the product instance data to an array.
_parseProductDescriptionData()  : array<string|int, mixed>
Convert the product description instance data to an array.
_parseProductsQuantityUnitData()  : array<string|int, mixed>
Convert the product quantity unit instance data to an array.

Properties

Methods

insert()

Insert

public insert(ProductInterface $product) : int

Saves a new product in the database.

Parameters
$product : ProductInterface

Product entity which holds the values for the database columns.

Tags
throws
UnexpectedValueException

When no language id was found by the given language code.

throws
InvalidArgumentException

If the provided product is not valid.

Return values
int

Id of inserted product.

_parseProductDescriptionData()

Convert the product description instance data to an array.

protected _parseProductDescriptionData(ProductInterface $product, LanguageCode $languageCode) : array<string|int, mixed>
Parameters
$product : ProductInterface
$languageCode : LanguageCode
Tags
throws
InvalidArgumentException

If the provided language code or product is not valid.

Return values
array<string|int, mixed>

_parseProductsQuantityUnitData()

Convert the product quantity unit instance data to an array.

protected _parseProductsQuantityUnitData(IdType $productId, IdType $quantityUnitId) : array<string|int, mixed>
Parameters
$productId : IdType
$quantityUnitId : IdType
Return values
array<string|int, mixed>

Search results