openmediavault
4.0 (Arrakis)
The open network attached storage solution
|
Public Member Functions | |
__construct (array $data=[]) | |
exists ($key) | |
assertExists ($key) | |
getData () | |
get ($key, $default=NULL) | |
set ($key, $value) | |
copy ($srcKey, $destKey) | |
remove ($key) | |
toJson () | |
fromJson ($json="") | |
Protected Member Functions | |
isValidKey ($key) | |
assertValidKey ($key) | |
Represents a collection of keys and values.
OMV\Dictionary::__construct | ( | array | $data = [] | ) |
Constructor.
data | The associative array containing the data. |
OMV\Dictionary::assertExists | ( | $key | ) |
Assert that the specified key exists.
key | The key in dot notation, e.g. 'a.b.c'. |
|
protected |
Assert that the given key is valid.
key | The key in dot notation, e.g. 'a.b.c'. |
OMV\Dictionary::copy | ( | $srcKey, | |
$destKey | |||
) |
Copy a key.
srcKey | The source key in dot notation, e.g. 'a.b.c'. |
destKey | The destination key in dot notation, e.g. 'a.b.c'. |
OMV\Dictionary::exists | ( | $key | ) |
Check whether the specified key exists.
key | The key in dot notation, e.g. 'a.b.c'. |
OMV\Dictionary::fromJson | ( | $json = "" | ) |
Import JSON data.
json | The JSON string. |
OMV\Dictionary::get | ( | $key, | |
$default = NULL |
|||
) |
Get the value for a key.
key | The key in dot notation, e.g. 'a.b.c'. |
default | The optional default value. |
OMV\Dictionary::getData | ( | ) |
Get the whole data.
|
protected |
Check whether the given key is valid.
key | The key in dot notation, e.g. 'a.b.c' or 'a.b.0.c.1' |
OMV\Dictionary::remove | ( | $key | ) |
Remove a key.
key | The key in dot notation, e.g. 'a.b.c'. |
OMV\Dictionary::set | ( | $key, | |
$value | |||
) |
Set a value for a key.
key | The key in dot notation, e.g. 'a.b.c'. |
value | The value of the given key. |
OMV\Dictionary::toJson | ( | ) |
Convert the data to JSON.