## 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 2347 2007-12-20 16:45:12Z xue $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /TComponent.php (line 678)

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

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

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

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

string getClassName ()
getEvents (line 823)

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

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

- 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 Mon, 21 Apr 2008 11:33:52 -0400 by phpDocumentor 1.3.0RC4