Class ProductRepository

Class ProductRepository

ProductRepository implements ProductRepositoryInterface

Methods summary

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

Initialize the product repository.

public add( ProductInterface $product ) : integer

Adds a new product in the database.

public store( StoredProductInterface $product ) : ProductRepositoryInterface|ProductRepository

Updates an existing product in the database.

public getProductById( IdType $productId ) : StoredProductInterface

Gets a stored product by the given id.

public deleteProductById( IdType $productId ) : ProductRepositoryInterface|ProductRepository

Removes a product from the database by the given id.

public getProductsCount( void ) : integer

Returns the count of all product entries.

Properties summary