Class \Prado\Collections\TAttributeCollection
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.
Class hierarchy
- \Prado\Collections\TAttributeCollection
-
\Prado\Collections\TMap implements IteratorAggregate, ArrayAccess, Countable
-
\Prado\TComponent
Since: 3.0
public
|
__get(string $name) : mixed
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) : mixed
Sets value of a component property.
This method overrides the parent implementation by adding a new key value to the collection. |
public
|
add(mixed $key, mixed $value) : mixed
Adds an item into the map.
This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false. |
public
|
canGetProperty(string $name) : bool
Determines whether a property can be read.
This method overrides parent implementation by returning true if the collection contains the named key. |
public
|
canSetProperty(string $name) : bool
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. |
public
|
contains(mixed $key) : bool
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
|
|
public
|
hasProperty(string $name) : bool
Determines whether a property is defined.
This method overrides parent implementation by returning true if the collection contains the named key. |
public
|
itemAt(mixed $key) : mixed
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
|
remove(mixed $key) : mixed
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
|
|
protected
|
_getZappableSleepProps(array<string|int, mixed> &$exprops) : mixed
Returns an array with the names of all variables of this object that should NOT be serialized
because their value is the default one or useless to be cached for the next page loads.
Reimplement in derived classes to add new variables, but remember to also to call the parent implementation first. |
\Prado\TComponent::GLOBAL_RAISE_EVENT_LISTENER |