Class ClassDescriptor
Manages class extensions properties.
Final
Namespace: Core
Package: Core
Since:
3.1
Requires:
PHP 5.3
Version:
1.0
Located at Object.inc.php
Methods summary
public static
Core\ClassDescriptor
|
#
get( string|object $classOrInstance )
Retrieves the class descriptor for a given class or object.
Retrieves the class descriptor for a given class or object.
This method equals Core\ClassDescriptor::lookup() except that always a class descriptor
is returned. If no class descriptor exists, a new descriptor is allocated.
If the class is not a descendant of Core\Object then an exception is
thrown.
Parameters
- $classOrInstance
- Class name or object instance to return class descriptor for.
Returns
Throws
Since
3.1
|
public static
Core\ClassDescriptor
|
#
lookup( string|object $classOrInstance )
Retrieves an existing class descriptor for a given class or object.
Retrieves an existing class descriptor for a given class or object.
This method equals Core\ClassDescriptor::get() except that null is returned,
if no class descriptor for the queried class name was initialised or
the class is not a descendant of Core\Object .
Parameters
- $classOrInstance
- Class name or object instance to return class descriptor for.
Returns
Core\ClassDescriptor Class descriptor instance of provided class name or object, if a class
descriptor exists, otherwise null .
Since
3.1
|
public
|
#
attachMethod( $methodName, $instance, $instanceMethod )
Attaches a method to the class managed by the class descriptor.
Attaches a method to the class managed by the class descriptor.
Parameters
- $methodName
- Name of method to attach.
- $instance
- Instance that holds the method to be injected.
- $instanceMethod
- Name of method in instance to inject.
Returns
$this
Since
3.1
|
public
mixed
|
#
attachedMethod( string $methodName )
Performs lookup for an attached method.
Performs lookup for an attached method.
The return value is subject to change and hence not yet clearly defined.
Parameters
- $methodName
- Name of method to lookup.
Returns
mixed Data structure storing details on the attached method or null ,
if no such method exists.
Since
3.1
|
Properties summary
protected
array
|
$_v_attachedMethods
Holds all methods attached to a class.
Holds all methods attached to a class.
Since
3.1
|
|
Magic properties
public read-only
array
|
$attachedMethods
Array of methods attached to the class described by the descriptor instance. Keys are the names of the attached methods, values a pair of class/object and the name of the respective method implementing the attached method call.
|