31 if ($pSource !== null) {
45 if ($pSource == null) {
49 foreach ($pSource as $item) {
62 if (!isset($this->items[$hash])) {
63 $this->items[$hash] = $pSource;
64 $this->keyMap[
count($this->items) - 1] = $hash;
76 if (isset($this->items[$hash])) {
77 unset($this->items[$hash]);
80 foreach ($this->keyMap as
$key => $value) {
81 if ($deleteKey >= 0) {
82 $this->keyMap[
$key - 1] = $value;
85 if ($value == $hash) {
89 unset($this->keyMap[
count($this->keyMap) - 1]);
109 return count($this->items);
121 return array_search($pHashCode, $this->keyMap);
133 if (isset($this->keyMap[$pIndex])) {
149 if (isset($this->items[$pHashCode])) {
150 return $this->items[$pHashCode];
171 $vars = get_object_vars($this);
172 foreach ($vars as
$key => $value) {
174 if (is_array($value)) {
176 foreach ($array1 as $key1 => $value1) {
177 if (is_object($value1)) {
178 $array1[$key1] = clone $value1;
181 $this->
$key = $array1;
toArray()
HashTable to array.
getByIndex($pIndex)
Get by index.
__construct($pSource=null)
Create a new .
__clone()
Implement PHP __clone to create a deep clone, not just a shallow copy.
getByHashCode($pHashCode)
Get by hashcode.
addFromSource(?array $pSource=null)
Add HashTable items from source.
getIndexForHashCode($pHashCode)
Get index for hash code.
add(IComparable $pSource)
Add HashTable item.
getHashCode()
Get hash code.