Class TComponentReflection

Description

TComponentReflection class.

TComponentReflection provides functionalities to inspect the properties and events defined in a component. It shows the definition of component properties, including their name, type, writability and defining class. It also shows the definition of component events, including their name and defining class.

Note, only public properties and events are displayed.

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

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

Located in /TComponent.php (line 601)

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

Constructor.

  • access: public
  • throws: TInvalidDataTypeException if the object is not a component
TComponentReflection __construct (TComponent|string $component)
  • TComponent|string $component: the component instance or the class name
determinePropertyType (line 681)

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 693)
  • return: class name of the component
  • access: public
string getClassName ()
getEvents (line 713)
  • return: list of component events. Each array element is of the following structure: [name]=>event name,[class]=>the class where the event is inherited from
  • access: public
array getEvents ()
getProperties (line 704)
  • return: list of component properties. Each array element is of the following structure: [name]=>property name, [type]=>property type, [readonly]=>whether the property is read-only, [class]=>the class where the property is inherited from
  • 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 Mon, 01 May 2006 23:03:00 -0400 by phpDocumentor 1.3.0RC4