yana

phpDocumentor v 1.4.0

Class Registry

Description

Registry
This class implements a registry. You can operate on it via keys, identifying scalar values or arrays inside the registry.
Example for usage of the $key parameter:
 Array {
     ID1 => Array {
         ID2 => 'value'
     }
 }
To get the string 'value' from the array above use $key = 'ID1.ID2'
The wildcard '*' may be used to refer to the array as a whole.
  • access: public
Object
   |
   --FileSystemResource
      |
      --FileReadonly
         |
         --VDrive
            |
            --Registry
Method Summary
  • mixed getVar ([string $key = "*"])
  • mixed &getVarByReference ([string $key = "*"])
  • bool merge (string $key, array $array, [bool $overwrite = true])
  • bool setType (string $key, string $type)
  • bool setVar (string $key, mixed $value, [bool $overwrite = true])
  • bool setVarByReference (string $key, mixed &$value, [bool $overwrite = true])
  • bool unsetVar (string $key)

Methods

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.
  • access: public
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.
  • since: 2.9.5
  • access: public
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.
  • access: public
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.
  • access: public
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).
  • access: public
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).
  • since: 2.8.5
  • access: public
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.
  • access: public
inherited from base classes

Inherited From VDrive

Inherited From FileReadonly

Inherited From FileSystemResource

Inherited From Object

Documentation generated on Sat, 03 Jan 2009 22:22:30 +0100 by phpDocumentor 1.4.0

yana author: Thomas MeyerHomepage: www.yanaframework.net