PHP Класс Prado\Collections\TAttributeCollection
TAttributeCollection implements a collection for storing attribute names and values.
Besides all functionalities provided by {@link 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.
Показать файл
Открыть проект
Примеры использования класса
Открытые методы
Защищенные методы
Метод |
Описание |
|
_getZappableSleepProps ( &$exprops ) |
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. |
|
Описание методов
This method overrides the parent implementation by returning
a key value if the key exists in the collection.
public __get ( $name ) : mixed |
Результат |
mixed |
the property value or the event handler list |
This method overrides the parent implementation by adding a new key value
to the collection.
public __set ( $name, $value ) |
_getZappableSleepProps()
защищенный Метод
Reimplement in derived classes to add new variables, but remember to also to call the parent
implementation first.
This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false.
public add ( $key, $value ) |
canGetProperty()
публичный Метод
This method overrides parent implementation by returning true
if the collection contains the named key.
canSetProperty()
публичный Метод
This method overrides parent implementation by always returning true
because you can always add a new value to the collection.
contains()
публичный Метод
This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false.
getCaseSensitive()
публичный Метод
hasProperty()
публичный Метод
This method overrides parent implementation by returning true
if the collection contains the named key.
This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false.
public itemAt ( $key ) : mixed |
Результат |
mixed |
the element at the offset, null if no element is found at the offset |
This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false.
public remove ( $key ) : mixed |
Результат |
mixed |
the removed value, null if no such key exists. |
setCaseSensitive()
публичный Метод