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(), getClass(), getItemType(), getIterator(), import(), isFrozen(), isReadOnly(), remove(), search(), setArray(), setReadOnly(), updating(), __call(), __callStatic(), __clone(), __get(), __isset(), __set(), __unset() |
Method Details | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line 60 addpublic bool add (mixed $key, mixed $item) Inserts the specified element to the map. Implementation of:
|
|||||||||||||||||||||
line 81 appendpublic void append ($item) Append is not supported. Implementation of:
|
|||||||||||||||||||||
line 146 getpublic mixed get (string $key, [mixed $default = Returns variable or $default if there is no element.
|
|||||||||||||||||||||
line 92 getKeyspublic void getKeys () Returns a array of the keys contained in this map. return array Implementation of:
|
|||||||||||||||||||||
line 118 importpublic void import (array|\Traversable $arr) Import from array or any traversable object. Overridden in child classes as:
|
|||||||||||||||||||||
line 227 offsetExistspublic bool offsetExists (string $key) Exists item? (\ArrayAccess implementation).
|
|||||||||||||||||||||
line 202 offsetGetpublic mixed offsetGet (string $key) Returns item (\ArrayAccess implementation).
|
|||||||||||||||||||||
line 184 offsetSetpublic void offsetSet (string $key, object $item) Inserts (replaces) item (\ArrayAccess implementation).
|
|||||||||||||||||||||
line 244 offsetUnsetpublic void offsetUnset (string $key) Removes the element at the specified position in this list.
|
|||||||||||||||||||||
line 105 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 166 throwKeyNotFoundpublic void throwKeyNotFound ([$val = Do throw KeyNotFoundException?
|