ProductVariantsRepository
extends AbstractEventDispatchingRepository
in package
implements
ProductVariantsRepository
Class ProductVariantsRepository
Interfaces, Classes and Traits
- ProductVariantsRepository
- Interface ProductVariantsRepository
Table of Contents
- $deleter : ProductVariantsDeleter
- $eventDispatcher : EventDispatcherInterface
- $inserter : ProductVariantsInserter
- $mapper : ProductVariantsMapper
- $permitters : array<string|int, ProductVariantOperationPermitter>
- $reader : ProductVariantsReader
- $updater : ProductVariantsUpdater
- __construct() : mixed
- ProductVariantsRepository constructor.
- createMultipleProductVariants() : ProductVariantIds
- createProductVariant() : ProductVariantId
- deleteAllProductVariantsByProductId() : void
- deleteProductVariants() : void
- dispatchEntityEvents() : void
- dispatchEvent() : void
- filterProductVariants() : ProductVariants
- getProductVariantById() : ProductVariant
- getProductVariantsByProductId() : ProductVariants
- getProductVariantsTotalCount() : int
- registerOperationPermitter() : void
- storeProductVariants() : void
- unlinkOptionFromProduct() : void
- validateThatOptionValuesBelongToOption() : void
- setEventDispatcher() : void
Properties
$deleter
private
ProductVariantsDeleter
$deleter
$eventDispatcher
private
EventDispatcherInterface
$eventDispatcher
$inserter
private
ProductVariantsInserter
$inserter
$mapper
private
ProductVariantsMapper
$mapper
$permitters
private
array<string|int, ProductVariantOperationPermitter>
$permitters
= []
$reader
private
ProductVariantsReader
$reader
$updater
private
ProductVariantsUpdater
$updater
Methods
__construct()
ProductVariantsRepository constructor.
public
__construct(ProductVariantsReader $reader, ProductVariantsDeleter $deleter, ProductVariantsInserter $inserter, ProductVariantsUpdater $updater, ProductVariantsMapper $mapper, EventDispatcherInterface $eventDispatcher) : mixed
Parameters
- $reader : ProductVariantsReader
- $deleter : ProductVariantsDeleter
- $inserter : ProductVariantsInserter
- $updater : ProductVariantsUpdater
- $mapper : ProductVariantsMapper
- $eventDispatcher : EventDispatcherInterface
Return values
mixed —createMultipleProductVariants()
public
createMultipleProductVariants(array<string|int, mixed> ...$creationArgs) : ProductVariantIds
Parameters
- $creationArgs : array<string|int, mixed>
Tags
Return values
ProductVariantIds —createProductVariant()
public
createProductVariant(ProductId $productId, OptionAndOptionValueIds $combination, ImageListId $imageListId, ProductCustomization $productCustomization, ProductIdentificationNumbers $productIdentificationNumbers, ProductVariantStock $stock, int $sortOrder) : ProductVariantId
Parameters
- $productId : ProductId
- $combination : OptionAndOptionValueIds
- $imageListId : ImageListId
- $productCustomization : ProductCustomization
- $productIdentificationNumbers : ProductIdentificationNumbers
- $stock : ProductVariantStock
- $sortOrder : int
Tags
Return values
ProductVariantId —deleteAllProductVariantsByProductId()
public
deleteAllProductVariantsByProductId(ProductId $productId) : void
Parameters
- $productId : ProductId
Tags
Return values
void —deleteProductVariants()
public
deleteProductVariants(ProductVariantId ...$ids) : void
Parameters
- $ids : ProductVariantId
Tags
Return values
void —dispatchEntityEvents()
public
dispatchEntityEvents(EventRaisingEntity $entity) : void
Parameters
- $entity : EventRaisingEntity
Tags
Return values
void —dispatchEvent()
public
dispatchEvent(object $event) : void
Parameters
- $event : object
Tags
Return values
void —filterProductVariants()
public
filterProductVariants(ProductId $productId, Filters $filters, Sorting $sorting, Pagination $pagination) : ProductVariants
Parameters
- $productId : ProductId
- $filters : Filters
- $sorting : Sorting
- $pagination : Pagination
Tags
Return values
ProductVariants —getProductVariantById()
public
getProductVariantById(ProductVariantId $id) : ProductVariant
Parameters
- $id : ProductVariantId
Tags
Return values
ProductVariant —getProductVariantsByProductId()
public
getProductVariantsByProductId(ProductId $productId) : ProductVariants
Parameters
- $productId : ProductId
Tags
Return values
ProductVariants —getProductVariantsTotalCount()
public
getProductVariantsTotalCount(ProductId $productId, Filters $filters) : int
Parameters
Tags
Return values
int —registerOperationPermitter()
public
registerOperationPermitter(ProductVariantOperationPermitter $permitter) : void
Parameters
- $permitter : ProductVariantOperationPermitter
Tags
Return values
void —storeProductVariants()
public
storeProductVariants(ProductVariant ...$productVariants) : void
Parameters
- $productVariants : ProductVariant
Tags
Return values
void —unlinkOptionFromProduct()
public
unlinkOptionFromProduct(ProductId $productId, int $optionId) : void
Parameters
- $productId : ProductId
- $optionId : int
Tags
Return values
void —validateThatOptionValuesBelongToOption()
public
validateThatOptionValuesBelongToOption(array<string|int, mixed> $optionAndOptionValueIds) : void
Parameters
- $optionAndOptionValueIds : array<string|int, mixed>
Tags
Return values
void —setEventDispatcher()
protected
setEventDispatcher(EventDispatcherInterface $eventDispatcher) : void
Parameters
- $eventDispatcher : EventDispatcherInterface