Implements interfaces:
TMap class
TMap implements a collection that takes key-value pairs.
You can access, add or remove an item with a key by using itemAt, add, and remove. To get the number of the items in the map, use getCount. TMap can also be used like a regular array as follows,
- $map[$key]=$value; // add a key-value pair
- unset($map[$key]); // remove the value with the specified key
- if(isset($map[$key])) // if the map contains the key
- foreach($map as $key=>$value) // traverse the items in the map
- $n=count($map); // returns the number of items in the map
Located in /Collections/TMap.php (line 35)
TComponent | --TMap
Class | Description |
---|---|
TAttributeCollection | TAttributeCollection class |
Constructor.
Initializes the list with an array or an iterable object.
Adds an item into the map.
Note, if the specified key already exists, the old value will be overwritten.
Removes all items in the map.
Copies iterable data into the map.
Note, existing data in the map will be cleared first.
Returns the number of items in the map.
This method is required by Countable interface.
Returns an iterator for traversing the items in the list.
This method is required by the interface IteratorAggregate.
Returns the item with the specified key.
This method is exactly the same as offsetGet.
Merges iterable data into the map.
Existing data in the map will be kept and overwritten if the keys are the same.
Returns whether there is an element at the specified offset.
This method is required by the interface ArrayAccess.
Returns the element at the specified offset.
This method is required by the interface ArrayAccess.
Sets the element at the specified offset.
This method is required by the interface ArrayAccess.
Unsets the element at the specified offset.
This method is required by the interface ArrayAccess.
Removes an item from the map by its key.
Inherited From TComponent
TComponent::addParsedObject()
TComponent::attachEventHandler()
TComponent::canGetProperty()
TComponent::canSetProperty()
TComponent::createdOnTemplate()
TComponent::detachEventHandler()
TComponent::evaluateExpression()
TComponent::evaluateStatements()
TComponent::getEventHandlers()
TComponent::getSubProperty()
TComponent::hasEvent()
TComponent::hasEventHandler()
TComponent::hasProperty()
TComponent::raiseEvent()
TComponent::setSubProperty()
TComponent::__get()
TComponent::__set()
Documentation generated on Mon, 21 Apr 2008 11:35:34 -0400 by phpDocumentor 1.3.0RC4