ProductRepositoryInterface
in
Interface ProductRepositoryInterface
Tags
Table of Contents
- 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
- Returns 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.
Methods
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.
Return values
int —Id of inserted product.
countImageUsage()
public
countImageUsage(ProductImageInterface $productImage) : int
Parameters
- $productImage : ProductImageInterface
Return values
int —deleteProductById()
Removes a product from the database by the given id.
public
deleteProductById(IdType $productId) : ProductRepositoryInterface|$this
Parameters
- $productId : IdType
-
Id of expected product entity.
Return values
ProductRepositoryInterface|$this —Same instance for chained method calls.
getProductById()
Returns a stored product by the given id.
public
getProductById(IdType $productId) : StoredProductInterface
Parameters
- $productId : IdType
-
Id of expected product entity.
Return values
StoredProductInterface —Product entity with the expected product id.
getProductsCount()
Returns the count of all product entries.
public
getProductsCount() : int
Return values
int —store()
Updates an existing product in the database.
public
store(StoredProductInterface $product) : ProductRepositoryInterface|$this
Parameters
- $product : StoredProductInterface
-
Product entity to update.
Return values
ProductRepositoryInterface|$this —Same instance for chained method calls.