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.
부터: 3.0
저자: Qiang Xue ([email protected])
상속: extends TMap
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

공개 메소드들

메소드 설명
__get ( $name ) : mixed Returns a property value or an event handler list by property or event name.
__set ( $name, $value ) Sets value of a component property.
add ( $key, $value ) Adds an item into the map.
canGetProperty ( $name ) : boolean Determines whether a property can be read.
canSetProperty ( $name ) : boolean Determines whether a property can be set.
contains ( $key ) : boolean Returns whether the specified is in the map.
getCaseSensitive ( ) : boolean
hasProperty ( $name ) : boolean Determines whether a property is defined.
itemAt ( $key ) : mixed Returns the item with the specified key.
remove ( $key ) : mixed Removes an item from the map by its key.
setCaseSensitive ( $value )

보호된 메소드들

메소드 설명
_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.

메소드 상세

__get() 공개 메소드

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

__set() 공개 메소드

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.
protected _getZappableSleepProps ( &$exprops )

add() 공개 메소드

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.
public canGetProperty ( $name ) : boolean
리턴 boolean whether the property can be read

canSetProperty() 공개 메소드

This method overrides parent implementation by always returning true because you can always add a new value to the collection.
public canSetProperty ( $name ) : boolean
리턴 boolean true

contains() 공개 메소드

This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false.
public contains ( $key ) : boolean
리턴 boolean whether the map contains an item with the specified key

getCaseSensitive() 공개 메소드

public getCaseSensitive ( ) : boolean
리턴 boolean whether the keys are case-sensitive. Defaults to false.

hasProperty() 공개 메소드

This method overrides parent implementation by returning true if the collection contains the named key.
public hasProperty ( $name ) : boolean
리턴 boolean whether the property is defined

itemAt() 공개 메소드

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

remove() 공개 메소드

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() 공개 메소드

public setCaseSensitive ( $value )