ProductSettingsRepository

Implements \ProductSettingsRepositoryInterface

Class ProductSettingsRepository

category

System

package

Product

subpackage

Repositories

Methods

Initialize the product settings repository.

__construct(\ProductSettingsRepositoryReaderInterface $reader, \ProductSettingsRepositoryWriterInterface $writer) 

Arguments

$reader

\ProductSettingsRepositoryReaderInterface

Instance to perform db read actions.

$writer

\ProductSettingsRepositoryWriterInterface

Instance to perform db write actions.

Returns a product settings by the given product id.

getProductSettingsById(\IdType $productId) : \ProductSettingsInterface

Arguments

$productId

\IdType

Id of product entity.

Response

\ProductSettingsInterface

Entity with product settings for the expected product id.

Saves product settings in the database by the given id.

store(\IdType $productId, \ProductSettingsInterface $settings) : \ProductSettingsRepositoryInterface|$this

Arguments

$productId

\IdType

Id of product entity.

$settings

\ProductSettingsInterface

Settings entity with values to store.

Response

\ProductSettingsRepositoryInterface|$this

Same instance for chained method calls.

Properties

reader

reader : \ProductSettingsRepositoryReaderInterface

writer

writer : \ProductSettingsRepositoryWriterInterface