phpDocumentor

ProductRepository
in package
implements ProductRepositoryInterface

Class ProductRepository

Tags
category

System

subpackage

Repositories

Interfaces, Classes and Traits

ProductRepositoryInterface
Interface ProductRepositoryInterface

Table of Contents

$addonValueService  : AddonValueServiceInterface
$deleter  : ProductRepositoryDeleterInterface
$imageContainerRepo  : ProductImageContainerRepositoryInterface
$reader  : ProductRepositoryReaderInterface
$settingsRepo  : ProductSettingsRepositoryInterface
$urlRewriteStorage  : UrlRewriteStorage
$writer  : ProductRepositoryWriterInterface
__construct()  : mixed
Initialize the product repository.
add()  : int
Adds a new product in the database.
countImageUsage()  : int
deleteProductById()  : ProductRepositoryInterface|$this
Removes a product from the database by the given id.
getProductById()  : StoredProductInterface
Gets a stored product by the given id.
getProductsCount()  : int
Returns the count of all product entries.
store()  : ProductRepositoryInterface|$this
Updates an existing product in the database.

Properties

Methods

__construct()

Initialize the product repository.

public __construct(ProductRepositoryReaderInterface $reader, ProductRepositoryWriterInterface $writer, ProductRepositoryDeleterInterface $deleter, ProductSettingsRepositoryInterface $settingsRepo, AddonValueServiceInterface $addonValueService, ProductImageContainerRepositoryInterface $imageContainerRepo, UrlRewriteStorage $urlRewriteStorage) : mixed
Parameters
$reader : ProductRepositoryReaderInterface

Instance to perform db read actions.

$writer : ProductRepositoryWriterInterface

Instance to perform db write actions.

$deleter : ProductRepositoryDeleterInterface

Instance to perform db delete actions.

$settingsRepo : ProductSettingsRepositoryInterface

Repository instance to read/write/delete product settings.

$addonValueService : AddonValueServiceInterface

Service to handle product addon values.

$imageContainerRepo : ProductImageContainerRepositoryInterface

Image container of the product.

$urlRewriteStorage : UrlRewriteStorage

Url rewrite storage.

Return values
mixed

add()

Adds a new product in the database.

public add(ProductInterface $product) : int
Parameters
$product : ProductInterface

Product entity which holds the values for the database columns.

Tags
throws
InvalidArgumentException

If the provided product is not valid.

Return values
int

Id of inserted product.

getProductsCount()

Returns the count of all product entries.

public getProductsCount() : int
Return values
int

Search results