| Package | system.collections |
|---|---|
| Inheritance | class CAttributeCollection » CMap » CComponent |
| Implements | Countable, ArrayAccess, Traversable, IteratorAggregate |
| Since | 1.0 |
| Version | $Id: CAttributeCollection.php 433 2008-12-30 22:59:17Z qiang.xue $ |
$collection->text='text'; // same as: $collection->add('text','text');
echo $collection->text; // same as: echo $collection->itemAt('text');
| Property | Type | Description | Defined By |
|---|---|---|---|
| caseSensitive | boolean | whether the keys are case-sensitive. | CAttributeCollection |
| count | integer | the number of items in the map | CMap |
| iterator | CMapIterator | Returns an iterator for traversing the items in the list. | CMap |
| keys | array | the key list | CMap |
| readOnly | boolean | whether this map is read-only or not. | CMap |
| Method | Description | Defined By |
|---|---|---|
| __call() | Calls the named method which is not a class method. | CComponent |
| __construct() | Constructor. | CMap |
| __get() | Returns a property value or an event handler list by property or event name. | CAttributeCollection |
| __isset() | Checks if a property value is null. | CAttributeCollection |
| __set() | Sets value of a component property. | CAttributeCollection |
| __unset() | Sets a component property to be null. | CAttributeCollection |
| add() | Adds an item into the map. | CAttributeCollection |
| asa() | Returns the named behavior object. | CComponent |
| attachBehavior() | Attaches a behavior to this component. | CComponent |
| attachBehaviors() | Attaches a list of behaviors to the component. | CComponent |
| attachEventHandler() | Attaches an event handler to an event. | CComponent |
| canGetProperty() | Determines whether a property can be read. | CAttributeCollection |
| canSetProperty() | Determines whether a property can be set. | CAttributeCollection |
| clear() | Removes all items in the map. | CMap |
| contains() | Returns whether the specified is in the map. | CAttributeCollection |
| copyFrom() | Copies iterable data into the map. | CMap |
| count() | Returns the number of items in the map. | CMap |
| detachBehavior() | Detaches a behavior from the component. | CComponent |
| detachBehaviors() | Detaches all behaviors from the component. | CComponent |
| detachEventHandler() | Detaches an existing event handler. | CComponent |
| disableBehavior() | Disables an attached behavior. | CComponent |
| disableBehaviors() | Disables all behaviors attached to this component. | CComponent |
| enableBehavior() | Enables an attached behavior. | CComponent |
| enableBehaviors() | Enables all behaviors attached to this component. | CComponent |
| getCount() | CMap | |
| getEventHandlers() | Returns the list of attached event handlers for an event. | CComponent |
| getIterator() | Returns an iterator for traversing the items in the list. | CMap |
| getKeys() | CMap | |
| getReadOnly() | CMap | |
| hasEvent() | Determines whether an event is defined. | CComponent |
| hasEventHandler() | Checks whether the named event has attached handlers. | CComponent |
| hasProperty() | Determines whether a property is defined. | CAttributeCollection |
| itemAt() | Returns the item with the specified key. | CAttributeCollection |
| mergeArray() | Merges two arrays into one recursively. | CMap |
| mergeWith() | Merges iterable data into the map. | CMap |
| offsetExists() | Returns whether there is an element at the specified offset. | CMap |
| offsetGet() | Returns the element at the specified offset. | CMap |
| offsetSet() | Sets the element at the specified offset. | CMap |
| offsetUnset() | Unsets the element at the specified offset. | CMap |
| raiseEvent() | Raises an event. | CComponent |
| remove() | Removes an item from the map by its key. | CAttributeCollection |
| toArray() | CMap |
whether the keys are case-sensitive. Defaults to false.
|
public mixed __get(string $name)
| ||
| $name | string | the property name or the event name |
| {return} | mixed | the property value or the event handler list |
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 boolean __isset(string $name)
| ||
| $name | string | the property name or the event name |
| {return} | boolean | whether the property value is null |
Checks if a property value is null. This method overrides the parent implementation by checking if the key exists in the collection and contains a non-null value.
|
public void __set(string $name, mixed $value)
| ||
| $name | string | the property name or event name |
| $value | mixed | the property value or event handler |
Sets value of a component property. This method overrides the parent implementation by adding a new key value to the collection.
|
public void __unset(string $name)
| ||
| $name | string | the property name or the event name |
Sets a component property to be null. This method overrides the parent implementation by clearing the specified key value.
|
public void add(mixed $key, mixed $value)
| ||
| $key | mixed | key |
| $value | 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 boolean canGetProperty(string $name)
| ||
| $name | string | the property name |
| {return} | boolean | whether the property can be read |
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)
| ||
| $name | string | the property name |
| {return} | boolean | true |
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 boolean contains(mixed $key)
| ||
| $key | mixed | the key |
| {return} | boolean | whether the map contains an item with the specified 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)
| ||
| $name | string | the property name |
| {return} | boolean | whether the property is defined |
Determines whether a property is defined. This method overrides parent implementation by returning true if the collection contains the named key.
|
public mixed itemAt(mixed $key)
| ||
| $key | mixed | the key |
| {return} | mixed | the element at the offset, null if no element is found at the offset |
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 mixed remove(mixed $key)
| ||
| $key | mixed | the key of the item to be removed |
| {return} | mixed | the removed value, null if no such key exists. |
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.
Be the first person to leave a comment
Please login to leave your comment.