ProductRepositoryInterface

Extends

Interface ProductRepositoryInterface

category

System

package

Product

subpackage

Interfaces

Methods

Adds a new product in the database.

add(\ProductInterface $product) : integer

Arguments

$product

\ProductInterface

Product entity which holds the values for the database columns.

Response

integer

Id of inserted product.

Removes a product from the database by the given id.

deleteProductById(\IdType $productId) : \ProductRepositoryInterface|$this

Arguments

$productId

\IdType

Id of expected product entity.

Response

\ProductRepositoryInterface|$this

Same instance for chained method calls.

Returns a stored product by the given id.

getProductById(\IdType $productId) : \StoredProductInterface

Arguments

$productId

\IdType

Id of expected product entity.

Response

\StoredProductInterface

Product entity with the expected product id.

Returns the count of all product entries.

getProductsCount() : integer

Response

integer

Updates an existing product in the database.

store(\StoredProductInterface $product) : \ProductRepositoryInterface|$this

Arguments

$product

\StoredProductInterface

Product entity to update.

Response

\ProductRepositoryInterface|$this

Same instance for chained method calls.