Class TAttributeCollection
TAttributeCollection class
TAttributeCollection implements a collection for storing attribute names and values.
Besides all functionalities provided by TMap
, TAttributeCollection
allows you to get and set attribute values like getting and setting properties.
For example, the following usages are all valid for a TAttributeCollection
object:
$collection->Text='text'; echo $collection->Text;
They are equivalent to the following:
$collection->add('Text','text'); echo $collection->itemAt('Text');
Note, attribute names are case-insensitive. They are converted to lower-case in the collection storage.
- TComponent
-
TMap implements IteratorAggregate, ArrayAccess, Countable
-
TAttributeCollection
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.0
Located at Collections/TAttributeCollection.php
public
mixed
|
#
__get( string $name )
Returns a property value or an event handler list by property or event name. This method overrides the parent implementation by returning a key value if the key exists in the collection. |
public
|
#
__set( string $name, mixed $value )
Sets value of a component property. This method overrides the parent implementation by adding a new key value to the collection. |
public
boolean
|
|
public
|
|
public
mixed
|
#
itemAt( mixed $key )
Returns the item with the specified key. This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false. |
public
|
#
add( mixed $key, mixed $value )
Adds an item into the map. This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false. |
public
mixed
|
#
remove( mixed $key )
Removes an item from the map by its key. This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false. |
public
boolean
|
#
contains( mixed $key )
Returns whether the specified is in the map. This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false. |
public
boolean
|
#
hasProperty( string $name )
Determines whether a property is defined. This method overrides parent implementation by returning true if the collection contains the named key. |
public
boolean
|
#
canGetProperty( string $name )
Determines whether a property can be read. This method overrides parent implementation by returning true if the collection contains the named key. |
public
boolean
|
#
canSetProperty( string $name )
Determines whether a property can be set. This method overrides parent implementation by always returning true because you can always add a new value to the collection. |
__construct(),
clear(),
copyFrom(),
count(),
getCount(),
getIterator(),
getKeys(),
getReadOnly(),
mergeWith(),
offsetExists(),
offsetGet(),
offsetSet(),
offsetUnset(),
setReadOnly(),
toArray()
|
GLOBAL_RAISE_EVENT_LISTENER
|