|
Class TComponentReflection
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());
-
TComponent
-
TComponentReflection
Methods summary
public
|
#
__construct( object|string $component )
Constructor.
Parameters
- $component
object|string the component instance or the class name
Throws
Overrides
|
protected
string
|
#
determinePropertyType( ReflectionMethod $method )
Determines the property type. This method uses the doc comment to determine
the property type.
Determines the property type. This method uses the doc comment to determine
the property type.
Parameters
Returns
string the property type, '{unknown}' if type cannot be determined from comment
|
public
string
|
#
getClassName( )
Returns
string class name of the component
|
public
array
|
#
getProperties( )
Returns
array 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.
|
public
array
|
#
getEvents( )
Returns
array 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.
|
public
array
|
#
getMethods( )
Returns
array 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.
|
Methods inherited from TComponent
__call(),
__destruct(),
__get(),
__isset(),
__set(),
__sleep(),
__unset(),
__wakeup(),
addParsedObject(),
asa(),
attachBehavior(),
attachBehaviors(),
attachClassBehavior(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
clearBehaviors(),
createdOnTemplate(),
detachBehavior(),
detachBehaviors(),
detachClassBehavior(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
evaluateStatements(),
fxAttachClassBehavior(),
fxDetachClassBehavior(),
getAutoGlobalListen(),
getBehaviorsEnabled(),
getClassHierarchy(),
getEventHandlers(),
getListeningToGlobalEvents(),
getSubProperty(),
hasEvent(),
hasEventHandler(),
hasProperty(),
isa(),
listen(),
raiseEvent(),
setSubProperty(),
unlisten()
|
|