Data
extends Data
in package
Alias
Table of Contents
- ON_LOAD = 'data.on.load'
- This event will be dispatched when the data is loaded.
- $bag : array<string|int, mixed>
- The currently loaded data.
- get() : mixed
- Gets a value of a key from `self::$bag` via dot-notation.
- getAll() : array<string|int, mixed>
- Returns the currently loaded data.
- has() : bool
- Checks whether a value of a key exists in `self::$bag` via dot-notation.
- set() : void
- Sets a value of a key in `self::$bag` via dot-notation.
- load() : void
- Loads the data from system configuration.
Constants
ON_LOAD
This event will be dispatched when the data is loaded.
public
string
ON_LOAD
= 'data.on.load'
This event will be passed a reference to the data array.
Properties
$bag
The currently loaded data.
protected
static array<string|int, mixed>
$bag
= []
Methods
get()
Gets a value of a key from `self::$bag` via dot-notation.
public
static get(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
-
The dotted key representation.
- $default : mixed = null
-
[optional] The default fallback value.
Return values
mixed —The requested value or null.
getAll()
Returns the currently loaded data.
public
static getAll() : array<string|int, mixed>
Return values
array<string|int, mixed> —has()
Checks whether a value of a key exists in `self::$bag` via dot-notation.
public
static has(string $key) : bool
Parameters
- $key : string
-
The dotted key representation.
Return values
bool —set()
Sets a value of a key in `self::$bag` via dot-notation.
public
static set(string $key, mixed $value) : void
Parameters
- $key : string
-
The dotted key representation.
- $value : mixed
-
The value to set.
Return values
void —load()
Loads the data from system configuration.
protected
static load() : void