Namespaces

  • Nette
    • Application
    • Caching
    • Collections
    • Config
    • Forms
    • IO
    • Loaders
    • Mail
    • Reflection
    • Security
    • Templates
    • Web
  • None
  • PHP

Classes

  • ArrayList
  • Collection
  • Hashtable
  • Set

Interfaces

  • ICollection
  • IList
  • IMap
  • ISet

Exceptions

  • KeyNotFoundException
  • Overview
  • Namespace
  • Class
  • Tree
  • Other releases

Class Hashtable

Provides the base class for a generic collection of keys and values.

ArrayObject implements IteratorAggregate, Traversable, ArrayAccess, Serializable, Countable
Extended by Nette\Collections\Collection implements Nette\Collections\ICollection
Extended by Nette\Collections\Hashtable implements Nette\Collections\IMap

Direct known subclasses

Nette\Config\Config
Namespace: Nette\Collections
Author: David Grudl
Located at Collections/Hashtable.php
Methods summary
public boolean
# add( mixed $key, mixed $item )

Inserts the specified element to the map.

Inserts the specified element to the map.

Parameters

$key
mixed
$item
mixed

Returns

boolean

Throws

InvalidArgumentException,
\InvalidStateException

Implementation of

Nette\Collections\IMap::add
public
# append( mixed $item )

Append is not supported.

Append is not supported.

Parameters

$item
mixed

Throws

InvalidArgumentException
public
# getKeys( )

Returns a array of the keys contained in this map. return array

Returns a array of the keys contained in this map. return array

Implementation of

Nette\Collections\IMap::getKeys
public 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.

Returns the key of the first occurrence of the specified element,. or FALSE if this map does not contain this element.

Parameters

$item
mixed

Returns

mixed
public
# import( array|Traversable $arr )

Import from array or any traversable object.

Import from array or any traversable object.

Parameters

$arr
array|Traversable

Throws

InvalidArgumentException
public mixed
# get( string $key, mixed $default = NULL )

Returns variable or $default if there is no element.

Returns variable or $default if there is no element.

Parameters

$key
string
key
$default
mixed
default value

Returns

mixed

Throws

InvalidArgumentException
public
# throwKeyNotFound( $val = TRUE )

Do throw KeyNotFoundException?

Do throw KeyNotFoundException?

public
# offsetSet( string $key, object $item )

Inserts (replaces) item (\ArrayAccess implementation).

Inserts (replaces) item (\ArrayAccess implementation).

Parameters

$key
string
key
$item
object

Throws

NotSupportedException,
\InvalidArgumentException

Implementation of

ArrayAccess::offsetSet
public mixed
# offsetGet( string $key )

Returns item (\ArrayAccess implementation).

Returns item (\ArrayAccess implementation).

Parameters

$key
string
key

Returns

mixed

Throws

KeyNotFoundException,
\InvalidArgumentException

Implementation of

ArrayAccess::offsetGet
public boolean
# offsetExists( string $key )

Exists item? (\ArrayAccess implementation).

Exists item? (\ArrayAccess implementation).

Parameters

$key
string
key

Returns

boolean

Throws

InvalidArgumentException

Implementation of

ArrayAccess::offsetExists
public
# offsetUnset( string $key )

Removes the element at the specified position in this list.

Removes the element at the specified position in this list.

Parameters

$key
string
key

Throws

NotSupportedException,
\InvalidArgumentException

Implementation of

ArrayAccess::offsetUnset
Methods inherited from Nette\Collections\Collection
__call(), __callStatic(), __clone(), __construct(), __get(), __isset(), __set(), __unset(), beforeAdd(), clear(), contains(), exchangeArray(), freeze(), getItemType(), getIterator(), getReflection(), isFrozen(), remove(), setArray(), updating()
Methods inherited from ArrayObject
asort(), count(), getArrayCopy(), getFlags(), getIteratorClass(), ksort(), natcasesort(), natsort(), serialize(), setFlags(), setIteratorClass(), uasort(), uksort(), unserialize()
Constants inherited from ArrayObject
ARRAY_AS_PROPS, STD_PROP_LIST
Nette Framework 0.9.7 API documentation generated by ApiGen 2.3.0