OptionRepository
extends AbstractEventDispatchingRepository
in package
implements
OptionRepository
Class OptionRepository
Interfaces, Classes and Traits
- OptionRepository
- Interface OptionRepository
Table of Contents
- $eventDispatcher : EventDispatcherInterface
- $mapper : OptionMapper
- $permitters : array<string|int, OptionOperationPermitter>
- $reader : OptionReader
- $writer : OptionWriter
- __construct() : mixed
- OptionRepository constructor.
- createMultipleOptions() : OptionIds
- Creates and stores multiple new options.
- createOption() : OptionId
- Creates and stores a new option.
- deleteOptions() : void
- Deletes one or more existing options.
- dispatchEntityEvents() : void
- dispatchEvent() : void
- filterOptions() : Options
- Returns a filtered, sorted, paginated collection of options.
- getAllOptions() : Options
- Returns a collection of all options.
- getOptionById() : Option
- Returns a specific option based on the given option ID.
- getOptionsTotalCount() : int
- Returns the total count of filtered options.
- registerOperationPermitter() : void
- Registers an operation permitter, which can determine if a create, storage, deletion operation is permitted.
- storeOptions() : void
- Stores one or more existing options.
- setEventDispatcher() : void
Properties
$eventDispatcher
private
EventDispatcherInterface
$eventDispatcher
$mapper
private
OptionMapper
$mapper
$permitters
private
array<string|int, OptionOperationPermitter>
$permitters
$reader
private
OptionReader
$reader
$writer
private
OptionWriter
$writer
Methods
__construct()
OptionRepository constructor.
public
__construct(OptionMapper $mapper, OptionReader $reader, OptionWriter $writer, EventDispatcherInterface $eventDispatcher) : mixed
Parameters
- $mapper : OptionMapper
- $reader : OptionReader
- $writer : OptionWriter
- $eventDispatcher : EventDispatcherInterface
Return values
mixed —createMultipleOptions()
Creates and stores multiple new options.
public
createMultipleOptions(array<string|int, mixed> ...$creationArgs) : OptionIds
Parameters
- $creationArgs : array<string|int, mixed>
Tags
Return values
OptionIds —createOption()
Creates and stores a new option.
public
createOption(OptionDetails $details, NewOptionValues $newOptionValues, OptionType $type, int $sortOrder) : OptionId
Parameters
- $details : OptionDetails
- $newOptionValues : NewOptionValues
- $type : OptionType
- $sortOrder : int
Tags
Return values
OptionId —deleteOptions()
Deletes one or more existing options.
public
deleteOptions(OptionId ...$ids) : void
Parameters
- $ids : OptionId
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 —filterOptions()
Returns a filtered, sorted, paginated collection of options.
public
filterOptions(Filters $filters, Sorting $sorting, Pagination $pagination) : Options
Parameters
- $filters : Filters
- $sorting : Sorting
- $pagination : Pagination
Tags
Return values
Options —getAllOptions()
Returns a collection of all options.
public
getAllOptions() : Options
Tags
Return values
Options —getOptionById()
Returns a specific option based on the given option ID.
public
getOptionById(OptionId $id) : Option
Parameters
- $id : OptionId
Tags
Return values
Option —getOptionsTotalCount()
Returns the total count of filtered options.
public
getOptionsTotalCount(Filters $filters) : int
Parameters
- $filters : Filters
Tags
Return values
int —registerOperationPermitter()
Registers an operation permitter, which can determine if a create, storage, deletion operation is permitted.
public
registerOperationPermitter(OptionOperationPermitter $permitter) : void
Parameters
- $permitter : OptionOperationPermitter
Tags
Return values
void —storeOptions()
Stores one or more existing options.
public
storeOptions(Option ...$options) : void
Parameters
- $options : Option
Tags
Return values
void —setEventDispatcher()
protected
setEventDispatcher(EventDispatcherInterface $eventDispatcher) : void
Parameters
- $eventDispatcher : EventDispatcherInterface