YANA 4 PHP Framework
Docs For Class Hashtable
«utility» Hashtable
This is a static utility class to implement certain operations on hashtables (associative arrays).
Example for usage of the $key parameter:
Array { ID1 => Array { ID2 => 'value' } }To get the string 'value' from the hashtable above use $key = 'ID1.ID2'
The wildcard '*' may be used to refer to the hashtable as a whole.
Located in /includes/class_hashtable.php
Utility | --Hashtable
Name | Type | Description |
---|---|---|
$hash | array | |
$key | string | |
&$hash |
Returns bool(false) if the element identified by $key can not be found in the given hashtable or it is NULL. Returns bool(true) otherwise.
Name | Type | Description |
---|---|---|
$hash | array | |
$key | string | |
&$hash |
Finds the value identified by $key and returns it. If the value is not found NULL is returned.
Name | Type | Description |
---|---|---|
$hash | array | |
$key | string | |
&$hash |
Unsets the element identified by $key in the hashtable. Returns bool(false) if the element does not exist or the key is invalid. Returns bool(true) otherwise.
Name | Type | Description |
---|---|---|
$hash | array | |
$key | string | |
$value | mixed | |
&$hash |
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 hashtable with a non-array value. It returns bool(true) otherwise.
Name | Type | Description |
---|---|---|
$hash | array | |
$key | string | |
$value | mixed | |
&$hash | ||
&$value |
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 hashtable with a non-array value. It returns bool(true) otherwise.
Name | Type | Description |
---|---|---|
$hash | array | |
$key | string | |
$type | string | |
&$hash |
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.
Inherited From Utility
Documentation generated on Wed, 22 Nov 2006 20:19:07 +0100 by phpDocumentor 1.3.1