Public Member Functions | |
__construct ($array=array()) | |
OHash ($array=array()) | |
set ($key, $value) | |
setRef ($key, &$value) | |
setAll ($hash) | |
& | get ($key) |
remove ($key) | |
removeElement (&$o) | |
isEmpty () | |
size () | |
& | values () |
keys () | |
getNewIterator () | |
containsKey ($key) | |
containsValue ($value) | |
& | toHash () |
toString () | |
sort () | |
Static Public Member Functions | |
ArrayToHash ($array) | |
Public Attributes | |
$_hash |
This class implements a simple interface quite like java to handle associatives arrays (Hashtables).
Note:
Some problems may occurs with object references until php4.4 to avoid unwanted object copy, use setRef() method with objects or pass Ref objects to set().
Definition at line 41 of file OHash.php.
|
OHash constructor. php4.4 compliant constructor
|
|
OHash constructor. php4.4 compliant constructor
Definition at line 52 of file OHash.php. References __construct(), keys(), and ref(). Referenced by __construct(). |
|
Create an Hash object from a simple php array variable. This method assumes that the array is composed of serial key, value elements. For each pair of array element, the former will be used as key and the latter as value.
Definition at line 272 of file OHash.php. References ArrayToHash(). Referenced by ArrayToHash(). |
|
Test if this hash contains specified key.
Definition at line 225 of file OHash.php. References containsKey(). Referenced by containsKey(), and get(). |
|
Test if this hash contains specified value.
Definition at line 236 of file OHash.php. References containsValue(). Referenced by containsValue(). |
|
Retrieve value associated to specified key.
Definition at line 119 of file OHash.php. References containsKey(), and get(). Referenced by get(). |
|
Retrieve an hash iterator ready to use.
|
|
Returns true is hashtable empty.
Definition at line 170 of file OHash.php. References size(). |
|
Retrieve hash keys array.
Definition at line 204 of file OHash.php. Referenced by __construct(), remove(), and setAll(). |
|
Remove element associated to specified key from hash.
Definition at line 132 of file OHash.php. References $i, keys(), and remove(). Referenced by remove(). |
|
Remove an element from the Hash.
Definition at line 149 of file OHash.php. References $i, and removeElement(). Referenced by removeElement(). |
|
Set a value in this hash.
Definition at line 79 of file OHash.php. Referenced by set(). |
|
Set a map of values.
Definition at line 102 of file OHash.php. References keys(), ref(), and setAll(). Referenced by setAll(). |
|
Reference set. Until php4.4, it's the only way to avoid object/variable copy.
Definition at line 92 of file OHash.php. References ref(), and setRef(). Referenced by setRef(). |
|
Retrieve hash size (number of elements).
Definition at line 180 of file OHash.php. Referenced by isEmpty(). |
|
Sort hashtable on its keys. |
|
Returns the php array (hashtable) handled by this object.
|
|
Generate and return a string representation of this hashtable.
|
|
Retrieve hash values array.
Definition at line 190 of file OHash.php. References ref(). |
|
|