Class Hashtable (namespace Nette\Collections)
Provides the base class for a generic collection of keys and values.
ArrayObject | --Collection | --Hashtable
Implements interfaces:
Direct Known Sub-classes:
Public Method Summary | |
---|---|
bool |
add
(mixed $key, mixed $item)
Inserts the specified element to the map.
|
void |
append
($item)
Append is not supported.
|
mixed |
get
(string $key, [mixed $default =
NULL ])
Returns variable or $default if there is no element.
|
void |
getKeys
()
Returns a array of the keys contained in this map.
|
void |
import
(array|\Traversable $arr)
Import from array or any traversable object.
|
bool |
offsetExists
(string $key)
Exists item? (\ArrayAccess implementation).
|
mixed |
offsetGet
(string $key)
Returns item (\ArrayAccess implementation).
|
void |
offsetSet
(string $key, object $item)
Inserts (replaces) item (\ArrayAccess implementation).
|
void |
offsetUnset
(string $key)
Removes the element at the specified position in this list.
|
mixed |
search
(mixed $item)
Returns the key of the first occurrence of the specified element,.
|
void |
throwKeyNotFound
([$val =
TRUE ])
Do throw KeyNotFoundException?
|
Methods Inherited From Collection |
---|
__construct(), append(), beforeAdd(), clear(), contains(), exchangeArray(), freeze(), getItemType(), getIterator(), getReflection(), import(), isFrozen(), isReadOnly(), remove(), search(), setArray(), setReadOnly(), updating(), __call(), __callStatic(), __clone(), __get(), __isset(), __set(), __unset() |
Method Details | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line 46 addpublic bool add (mixed $key, mixed $item) Inserts the specified element to the map. Implementation of:
|
|||||||||||||||||||||
line 67 appendpublic void append ($item) Append is not supported. Implementation of:
|
|||||||||||||||||||||
line 132 getpublic mixed get (string $key, [mixed $default = Returns variable or $default if there is no element.
|
|||||||||||||||||||||
line 78 getKeyspublic void getKeys () Returns a array of the keys contained in this map. return array Implementation of:
|
|||||||||||||||||||||
line 104 importpublic void import (array|\Traversable $arr) Import from array or any traversable object. Overridden in child classes as:
|
|||||||||||||||||||||
line 213 offsetExistspublic bool offsetExists (string $key) Exists item? (\ArrayAccess implementation).
|
|||||||||||||||||||||
line 188 offsetGetpublic mixed offsetGet (string $key) Returns item (\ArrayAccess implementation).
|
|||||||||||||||||||||
line 170 offsetSetpublic void offsetSet (string $key, object $item) Inserts (replaces) item (\ArrayAccess implementation).
|
|||||||||||||||||||||
line 230 offsetUnsetpublic void offsetUnset (string $key) Removes the element at the specified position in this list.
|
|||||||||||||||||||||
line 91 searchpublic mixed search (mixed $item) Returns the key of the first occurrence of the specified element,. or FALSE if this map does not contain this element. Implementation of:
|
|||||||||||||||||||||
line 152 throwKeyNotFoundpublic void throwKeyNotFound ([$val = Do throw KeyNotFoundException?
|