retrieves var from registry
mixed
getVar
(
[string $key = "*"]
)
List of parameters:
Name |
Type |
Description |
$key |
string |
(optional) |
Description:
This returns the var identified by $key.
Note that you may use the following magic keys FOR THIS FUNCTION ONLY:
- <BOOLEAN> returns an one-dimensional associative array of all values converted to boolean
- <STRING> returns an one-dimensional associative array of all values converted to string, arrays are mapped to bool(true)
- <ARRAY> returns an array of all arrays, scalar values are mapped to an empty array
Returns bool(false) on error.
retrieves var from registry and returns it by reference
mixed
&getVarByReference
(
[string $key = "*"]
)
List of parameters:
Name |
Type |
Description |
$key |
string |
(optional) |
Description:
This returns the var identified by $key. Returns null (not bool(false)) on error.
Note: this function may return false but also other values that evaluates to false. To check for an error use: is_null($result). To check for bool(false) use: $result === false.
merges the value at adresse $key with the provided array data
bool
merge
(
string $key, array $array, [bool $overwrite = true]
)
List of parameters:
Name |
Type |
Description |
$key |
string |
key of updated element |
$array |
array |
new value |
$overwrite |
bool |
true = update, false = ignore |
Description:
Merges the element identified by $key with the array $value.
Returns bool(false) on error.
If $overwrite is set to false, then the values of keys that already exist are ignored. Otherwise these values get updated to the new ones.
sets the type of a var on registry
bool
setType
(
string $key, string $type
)
List of parameters:
Name |
Type |
Description |
$key |
string |
|
$type |
string |
|
Description:
Set the data type of the element identified by $key to $type.
Returns bool(false) if the element is NULL or does not exist, or the $type parameter is invalid. Returns bool(true) otherwise.
sets var on registry
bool
setVar
(
string $key, mixed $value, [bool $overwrite = true]
)
List of parameters:
Name |
Type |
Description |
$key |
string |
key of updated element |
$value |
mixed |
new value |
$overwrite |
bool |
true = replace, false = throw error |
Description:
Sets the element identified by $key to $value. If the value does not exist it gets inserted. If a previous value existed the value gets updated.
This function returns bool(false) if $key = '*' and $value is not an array - which is: trying overwrite the complete registry with a non-array value. It returns bool(true) otherwise.
If $overwrite is set to false and the $key does already exist, the current value is not replaced and the function returns bool(false).
sets var on registry by Reference
bool
setVarByReference
(
string $key, mixed &$value, [bool $overwrite = true]
)
List of parameters:
Name |
Type |
Description |
$key |
string |
|
&$value |
mixed |
|
$overwrite |
bool |
|
Description:
Sets the element identified by $key to $value by passing it's reference. If the value does not exist it gets inserted. If a previous value existed the value gets updated.
This function returns bool(false) if $key = '*' and $value is not an array - which is: trying overwrite the complete registry with a non-array value. It returns bool(true) otherwise.
If $overwrite is set to false and the $key does already exist, the current value is not replaced and the function returns bool(false).
removes var from registry
bool
unsetVar
(
string $key
)
List of parameters:
Name |
Type |
Description |
$key |
string |
|
Description:
Unsets the element identified by $key in the registry. Returns bool(false) if the element does not exist or the key is invalid. Returns bool(true) otherwise.
inherited from base classes
Inherited From VDrive
Inherited From FileReadonly
Inherited From FileSystemResource
Inherited From Object