Preset
in package
implements
YamlSerializable
Class Preset
Tags
Table of Contents
Interfaces
- YamlSerializable
- Class YamlSerializable
Constants
- DEFAULT = 'Default'
- Name of the default preset
Properties
- $name : string
- Name of the preset
- $optionValues : array<string|int, Value>
Methods
- createFromArray() : Preset
- Create a preset form a raw options array.
- getName() : mixed
- Get the name
- getOption() : Value
- Get a option
- isValidPresetName() : bool
- Checks if given name is a valid preset name.
- setName() : mixed
- Set the name
- setOption() : mixed
- Set a option
- setOptionValues() : mixed
- Set optionvalues.
- yamlSerialize() : array<string|int, mixed>
- Serialize a class to use in a .yml file.
Constants
DEFAULT
Name of the default preset
public
string
DEFAULT
= 'Default'
Properties
$name
Name of the preset
protected
string
$name
$optionValues
protected
array<string|int, Value>
$optionValues
= []
Methods
createFromArray()
Create a preset form a raw options array.
public
static createFromArray(mixed $name, mixed $options) : Preset
Parameters
- $name : mixed
- $options : mixed
Return values
PresetgetName()
Get the name
public
getName() : mixed
getOption()
Get a option
public
getOption(mixed $name) : Value
Parameters
- $name : mixed
Return values
ValueisValidPresetName()
Checks if given name is a valid preset name.
public
static isValidPresetName(mixed $presetName) : bool
Parameters
- $presetName : mixed
Return values
boolsetName()
Set the name
public
setName(mixed $name) : mixed
Parameters
- $name : mixed
setOption()
Set a option
public
setOption(mixed $name, mixed $value) : mixed
Parameters
- $name : mixed
- $value : mixed
setOptionValues()
Set optionvalues.
public
setOptionValues(mixed $optionValues) : mixed
Parameters
- $optionValues : mixed
yamlSerialize()
Serialize a class to use in a .yml file.
public
yamlSerialize() : array<string|int, mixed>
This should return a array which will be serialized by the caller.