ProductSettingsRepository
in package
implements
ProductSettingsRepositoryInterface
Class ProductSettingsRepository
Tags
Interfaces, Classes and Traits
- ProductSettingsRepositoryInterface
- Interface ProductSettingsRepositoryInterface
Table of Contents
- $reader : ProductSettingsRepositoryReaderInterface
- $writer : ProductSettingsRepositoryWriterInterface
- __construct() : mixed
- Initialize the product settings repository.
- getProductSettingsById() : ProductSettingsInterface
- Returns a product settings by the given product id.
- store() : ProductSettingsRepositoryInterface|$this
- Saves product settings in the database by the given id.
Properties
$reader
protected
ProductSettingsRepositoryReaderInterface
$reader
$writer
protected
ProductSettingsRepositoryWriterInterface
$writer
Methods
__construct()
Initialize the product settings repository.
public
__construct(ProductSettingsRepositoryReaderInterface $reader, ProductSettingsRepositoryWriterInterface $writer) : mixed
Parameters
- $reader : ProductSettingsRepositoryReaderInterface
-
Instance to perform db read actions.
- $writer : ProductSettingsRepositoryWriterInterface
-
Instance to perform db write actions.
Return values
mixed —getProductSettingsById()
Returns a product settings by the given product id.
public
getProductSettingsById(IdType $productId) : ProductSettingsInterface
Parameters
- $productId : IdType
-
Id of product entity.
Return values
ProductSettingsInterface —Entity with product settings for the expected product id.
store()
Saves product settings in the database by the given id.
public
store(IdType $productId, ProductSettingsInterface $settings) : ProductSettingsRepositoryInterface|$this
Parameters
- $productId : IdType
-
Id of product entity.
- $settings : ProductSettingsInterface
-
Settings entity with values to store.
Return values
ProductSettingsRepositoryInterface|$this —Same instance for chained method calls.