## 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: $Id: TComponent.php 1587 2007-01-01 17:21:22Z xue $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /TComponent.php (line 668)

    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 680)

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 775)

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 787)

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

string getClassName ()
getEvents (line 813)

- 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 826)

- 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 801)

- 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::addParsedObject()
> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::createdOnTemplate()
> 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, 14 Jan 2007 21:41:39 -0500 by phpDocumentor 1.3.0RC4