## Class TComponentReflection

Description

TComponentReflection class.

TComponentReflection provides functionalities to inspect the public/protected properties, events and methods defined in a class.

The following code displays the properties and events defined in TDataGrid,

       $reflection=new TComponentReflection('TDataGrid');
       Prado::varDump($reflection->getProperties());
       Prado::varDump($reflection->getEvents());

- since: 3.0
- version: $Revision: $ $Date: $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /TComponent.php (line 600)

    TComponent
       |
       --TComponentReflection

Method Summary
TComponentReflection __construct (object|string $component)
string determinePropertyType (ReflectionMethod $method)
string getClassName ()
array getEvents ()
array getMethods ()
array getProperties ()
Methods
Constructor __construct (line 612)

Constructor.

- access: public
- throws: TInvalidDataTypeException if the object is not a component

TComponentReflection __construct (object|string $component)

- object|string $component: the component instance or the class name

determinePropertyType (line 707)

Determines the property type.

This method uses the doc comment to determine the property type.

- return: the property type, '{unknown}' if type cannot be determined from comment
- access: protected

string determinePropertyType (ReflectionMethod $method)

- ReflectionMethod $method

getClassName (line 719)

- return: class name of the component
- access: public

string getClassName ()
getEvents (line 745)

- return: list of component events. Array keys are event names. Each array element is of the following structure: [protected]=>whether the event is protected or not [class]=>the class where the event is inherited from. [comments]=>comments associated with the event.
- access: public

array getEvents ()
getMethods (line 758)

- return: list of public/protected methods. Array keys are method names. Each array element is of the following structure: [protected]=>whether the method is protected or not [static]=>whether the method is static or not [class]=>the class where the property is inherited from, [comments]=>comments associated with the event.
- access: public

array getMethods ()
getProperties (line 733)

- return: list of component properties. Array keys are property names. Each array element is of the following structure: [type]=>property type, [readonly]=>whether the property is read-only, [protected]=>whether the method is protected or not [class]=>the class where the property is inherited from, [comments]=>comments associated with the property.
- access: public

array getProperties ()

#### Inherited Methods

Inherited From TComponent

> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Documentation generated on Sun, 04 Jun 2006 18:58:51 -0400 by phpDocumentor 1.3.0RC4