Entry
in package
Model that represent config values within an app config lexicon.
Tags
Attributes
- #[Consumable]
- $since: '32.0.0'
Table of Contents
Constants
Properties
- $default : string|null
- $defaultRaw : null|string|int|float|bool|array<string|int, mixed>|Closure
- $definition : string
- $deprecated : bool
- $flags : int
- $key : string
- $lazy : bool
- $note : string
- $options : int
- $rename : string|null
- $type : ValueType
Methods
- __construct() : mixed
- convertToString() : string
- convert $entry into string, based on the expected type for config value
- getDefault() : string|null
- returns default value
- getDefinition() : string
- returns definition
- getFlags() : int
- returns flags
- getKey() : string
- returns the config key
- getNote() : string
- returns eventual note
- getRename() : string|null
- should be called/used only during migration/upgrade.
- getValueType() : ValueType
- get expected type for config value
- hasOption() : bool
- isDeprecated() : bool
- returns if config key is set as deprecated
- isFlagged() : bool
- isLazy() : bool
- returns if config key is set as lazy
- convertFromArray() : string
- convertFromBool() : string
- convertFromFloat() : string
- convertFromInt() : string
- convertFromString() : string
Constants
RENAME_INVERT_BOOLEAN
public
mixed
RENAME_INVERT_BOOLEAN
= 1
Tags
Properties
$default
private
string|null
$default
= null
$defaultRaw
private
null|string|int|float|bool|array<string|int, mixed>|Closure
$defaultRaw
= null
$definition
private
string
$definition
= ''
$deprecated read-only
private
bool
$deprecated
= false
$flags read-only
private
int
$flags
= 0
$key read-only
private
string
$key
$lazy read-only
private
bool
$lazy
= false
$note
private
string
$note
= ''
$options read-only
private
int
$options
= 0
$rename read-only
private
string|null
$rename
= null
$type read-only
private
ValueType
$type
Methods
__construct()
public
__construct(string $key, ValueType $type[, string|int|float|bool|array<string|int, mixed>|Closure|null $defaultRaw = null ][, string $definition = '' ][, bool $lazy = false ][, int $flags = 0 ][, bool $deprecated = false ][, string|null $rename = null ][, int $options = 0 ][, string $note = '' ]) : mixed
Parameters
- $key : string
-
config key; can only contain alphanumerical chars and underscore "_"
- $type : ValueType
-
type of config value
- $defaultRaw : string|int|float|bool|array<string|int, mixed>|Closure|null = null
-
default value to be used in case none known
- $definition : string = ''
-
optional description of config key available when using occ command
- $lazy : bool = false
-
set config value as lazy
- $flags : int = 0
-
set flags
- $deprecated : bool = false
-
set config key as deprecated
- $rename : string|null = null
-
source in case of a rename of a config key.
- $options : int = 0
-
additional bitflag options self::RENAME_INVERT_BOOLEAN
- $note : string = ''
-
additional note and warning related to the use of the config key.
Tags
convertToString()
convert $entry into string, based on the expected type for config value
public
convertToString(string|int|float|bool|array<string|int, mixed> $entry) : string
Parameters
- $entry : string|int|float|bool|array<string|int, mixed>
Tags
Return values
stringgetDefault()
returns default value
public
getDefault(Preset $preset) : string|null
Parameters
- $preset : Preset
Tags
Return values
string|null —NULL if no default is set
getDefinition()
returns definition
public
getDefinition() : string
Tags
Return values
stringgetFlags()
returns flags
public
getFlags() : int
Tags
Return values
int —bitflag about the config value
getKey()
returns the config key
public
getKey() : string
Tags
Return values
string —config key
getNote()
returns eventual note
public
getNote() : string
Tags
Return values
stringgetRename()
should be called/used only during migration/upgrade.
public
getRename() : string|null
link to an old config key.
Tags
Return values
string|null —not NULL if value can be imported from a previous key
getValueType()
get expected type for config value
public
getValueType() : ValueType
Tags
Return values
ValueTypehasOption()
public
hasOption(int $option) : bool
Parameters
- $option : int
Tags
Return values
bool —TRUE if $option was set during the creation of the entry.
isDeprecated()
returns if config key is set as deprecated
public
isDeprecated() : bool
Tags
Return values
bool —TRUE if config si deprecated
isFlagged()
public
isFlagged(int $flag) : bool
Parameters
- $flag : int
Tags
Return values
bool —TRUE is config value bitflag contains $flag
isLazy()
returns if config key is set as lazy
public
isLazy() : bool
Tags
Return values
bool —TRUE if config value is lazy
convertFromArray()
private
convertFromArray(array<string|int, mixed> $default) : string
Parameters
- $default : array<string|int, mixed>
Tags
Return values
stringconvertFromBool()
private
convertFromBool(bool $default) : string
Parameters
- $default : bool
Tags
Return values
stringconvertFromFloat()
private
convertFromFloat(float $default) : string
Parameters
- $default : float
Tags
Return values
stringconvertFromInt()
private
convertFromInt(int $default) : string
Parameters
- $default : int
Tags
Return values
stringconvertFromString()
private
convertFromString(string $default) : string
Parameters
- $default : string