PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

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
Extended by TMap implements IteratorAggregate, ArrayAccess, Countable
Extended by TAttributeCollection
Package: System\Collections
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
Methods summary
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.

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.

Parameters

$name
string
the property name or the event name

Returns

mixed
the property value or the event handler list

Throws

TInvalidOperationException
if the property/event is not defined.

Overrides

TComponent::__get()
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.

Sets value of a component property. This method overrides the parent implementation by adding a new key value to the collection.

Parameters

$name
string
the property name or event name
$value
mixed
the property value or event handler

Throws

TInvalidOperationException
If the property is not defined or read-only.

Overrides

TComponent::__set()
public boolean
# getCaseSensitive( )

Returns

boolean
whether the keys are case-sensitive. Defaults to false.
public
# setCaseSensitive( boolean $value )

Parameters

$value
boolean
whether the keys are case-sensitive.
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.

Returns the item with the specified key. This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false.

Parameters

$key
mixed
the key

Returns

mixed
the element at the offset, null if no element is found at the offset

Overrides

TMap::itemAt()
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.

Adds an item into the map. This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false.

Parameters

$key
mixed
key
$value
mixed
value

Throws

TInvalidOperationException
if the map is read-only

Overrides

TMap::add()
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.

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.

Parameters

$key
mixed
the key of the item to be removed

Returns

mixed
the removed value, null if no such key exists.

Throws

TInvalidOperationException
if the map is read-only

Overrides

TMap::remove()
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.

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.

Parameters

$key
mixed
the key

Returns

boolean
whether the map contains an item with the specified key

Overrides

TMap::contains()
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.

Determines whether a property is defined. This method overrides parent implementation by returning true if the collection contains the named key.

Parameters

$name
string
the property name

Returns

boolean
whether the property is defined

Overrides

TComponent::hasProperty()
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.

Determines whether a property can be read. This method overrides parent implementation by returning true if the collection contains the named key.

Parameters

$name
string
the property name

Returns

boolean
whether the property can be read

Overrides

TComponent::canGetProperty()
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.

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.

Parameters

$name
string
the property name

Returns

boolean
true

Overrides

TComponent::canSetProperty()
Methods inherited from TMap
__construct(), clear(), copyFrom(), count(), getCount(), getIterator(), getKeys(), getReadOnly(), mergeWith(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), setReadOnly(), toArray()
Methods inherited from TComponent
__call(), __destruct(), __isset(), __sleep(), __unset(), __wakeup(), addParsedObject(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO