Option
extends AbstractEventRaisingEntity
in package
Class Option
Table of Contents
- $details : OptionDetails
- $id : OptionId
- $newValues : NewOptionValues
- $raisedEvents : array<string|int, object>
- $sortOrder : int
- $type : OptionType
- $values : OptionValues
- addNewValues() : void
- Adds a new value to this option.
- adminLabel() : string
- Returns the admin label of the option for a given language code.
- changeDetails() : void
- Updates the details of this option.
- changeSortOrder() : void
- Updates the sort order of this option.
- changeType() : void
- Updates the type of this option.
- changeValues() : void
- Updates already stored values of this option.
- create() : Option
- description() : string
- Returns the description of the option for a given language code.
- id() : int
- Returns the ID of the option.
- label() : string
- Returns the label of the option for a given language code.
- newValues() : NewOptionValues
- Returns the new (not stored) values of the option.
- releaseEvents() : array<string|int, object>
- removeValues() : void
- Removes already stored values from this option.
- sortOrder() : int
- Returns the sort order of the option.
- toArray() : array<string|int, mixed>
- Returns the the data of this option as array.
- type() : string
- Returns the type of the option.
- values() : OptionValues
- Returns the already stored values of the option.
- raiseEvent() : void
- __construct() : mixed
- Option constructor.
Properties
$details
private
OptionDetails
$details
$id
private
OptionId
$id
$newValues
private
NewOptionValues
$newValues
$raisedEvents
private
array<string|int, object>
$raisedEvents
= []
$sortOrder
private
int
$sortOrder
$type
private
OptionType
$type
$values
private
OptionValues
$values
Methods
addNewValues()
Adds a new value to this option.
public
addNewValues(NewOptionValue ...$newOptionValues) : void
Parameters
- $newOptionValues : NewOptionValue
Return values
void —adminLabel()
Returns the admin label of the option for a given language code.
public
adminLabel(string $languageCode) : string
Parameters
- $languageCode : string
Return values
string —changeDetails()
Updates the details of this option.
public
changeDetails(OptionDetails $newDetails) : void
Parameters
- $newDetails : OptionDetails
Return values
void —changeSortOrder()
Updates the sort order of this option.
public
changeSortOrder(int $newSortOrder) : void
Parameters
- $newSortOrder : int
Return values
void —changeType()
Updates the type of this option.
public
changeType(OptionType $newType) : void
Parameters
- $newType : OptionType
Return values
void —changeValues()
Updates already stored values of this option.
public
changeValues(OptionValue ...$optionValues) : void
Parameters
- $optionValues : OptionValue
Return values
void —create()
public
static create(OptionId $id, OptionDetails $details, OptionValues $values, NewOptionValues $newValues, OptionType $type, int $sortOrder) : Option
Parameters
- $id : OptionId
- $details : OptionDetails
- $values : OptionValues
- $newValues : NewOptionValues
- $type : OptionType
- $sortOrder : int
Return values
Option —description()
Returns the description of the option for a given language code.
public
description(string $languageCode) : string
Parameters
- $languageCode : string
Return values
string —id()
Returns the ID of the option.
public
id() : int
Return values
int —label()
Returns the label of the option for a given language code.
public
label(string $languageCode) : string
Parameters
- $languageCode : string
Return values
string —newValues()
Returns the new (not stored) values of the option.
public
newValues() : NewOptionValues
Return values
NewOptionValues —releaseEvents()
public
releaseEvents() : array<string|int, object>
Return values
array<string|int, object> —removeValues()
Removes already stored values from this option.
public
removeValues(OptionValueId ...$optionValueIds) : void
Parameters
- $optionValueIds : OptionValueId
Return values
void —sortOrder()
Returns the sort order of the option.
public
sortOrder() : int
Return values
int —toArray()
Returns the the data of this option as array.
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —type()
Returns the type of the option.
public
type() : string
Return values
string —values()
Returns the already stored values of the option.
public
values() : OptionValues
Return values
OptionValues —raiseEvent()
protected
raiseEvent(object $event) : void
Parameters
- $event : object
Return values
void —__construct()
Option constructor.
private
__construct(OptionId $id, OptionDetails $details, OptionValues $values, NewOptionValues $newValues, OptionType $type, int $sortOrder) : mixed
Parameters
- $id : OptionId
- $details : OptionDetails
- $values : OptionValues
- $newValues : NewOptionValues
- $type : OptionType
- $sortOrder : int