Zeta Components - high quality PHP components

Zeta Components Manual :: Docs For Class ezcReflectionObject

Reflection::ezcReflectionObject

Class ezcReflectionObject

Extends the ReflectionObject class to provide type information using PHPDoc annotations.

Source for this file: /Reflection/src/object.php

ReflectionObject
   |
   --ezcReflectionObject
Version:   //autogen//

Inherited Constants

From ReflectionObject (Internal Class):
IS_EXPLICIT_ABSTRACT = 32
IS_FINAL = 64
IS_IMPLICIT_ABSTRACT = 16

Member Variables

protected ezcReflectionDocCommentParser $docParser
protected object|ReflectionObject $reflectionSource

Inherited Member Variables

From ReflectionObject (Internal Class)
public $name

Method Summary

public static mixed export( $object , [ $return = false] )
Exports a ReflectionObject instance.
public ezcReflectionObject __construct( $argument )
Constructs a new ezcReflectionObject.
protected mixed forwardCallToReflectionSource( $method , [ $arguments = array()] )
Forwards a method invocation to either the reflection source passed to the constructor of this class when creating an instance or to the parent class.
public ezcReflectionAnnotation[] getAnnotations( [ $name = ''] )
Returns an array of annotations (optinally only annotations of a given name)
public mixed getConstant( $name )
Returns the class' constant specified by its name
public array getConstants( )
Returns an associative array containing this class' constants and their values.
public ezcReflectionMethod getConstructor( )
Returns an ezcReflectionMethod object of the constructor method.
public array getDefaultProperties( )
Returns an associative array containing copies of all default property values of the class.
public string getDocComment( )
Returns the doc comment for the class.
public integer getEndLine( )
Returns the line this class' declaration ends at
public ezcReflectionExtension getExtension( )
Returns NULL or the extension the class belongs to
public string|boolean getExtensionName( )
Returns FALSE or the name of the extension the class belongs to
public string getFileName( )
Returns the filename of the file this class was declared in
public string[] getInterfaceNames( )
Returns an array of names of interfaces this class implements
public ezcReflectionClass[] getInterfaces( )
Returns an array of all interfaces implemented by the class.
public string getLongDescription( )
Returns the long description of the class from the source code documentation
public ezcReflectionMethod getMethod( $name )
Returns an ezcReflectionMethod object of the method specified by $name.
public ezcReflectionMethod[] getMethods( [ $filter = -1] )
Returns the methods as an array of ezcReflectionMethod objects.
public integer getModifiers( )
Returns a bitfield of the access modifiers for this class
public string getName( )
Returns the name of the class.
public string getNamespaceName( )
Returns the name of namespace where this class is defined
public ezcReflectionClass|boolean getParentClass( )
Returns the class' parent class, or, if none exists, FALSE
public ezcReflectionProperty[] getProperties( [ $filter = -1] )
Returns an array of this class' properties
public ezcReflectionProperty getProperty( $name )
Returns the class' property specified by its name
public string getShortDescription( )
Returns the short description of the class from the source code documentation
public string getShortName( )
Returns the short name of the class (without namespace part)
public integer getStartLine( )
Returns the line this class' declaration starts at
public array getStaticProperties( )
Returns an associative array containing all static property values of the class
public mixed getStaticPropertyValue( $name , [ $default = null] )
Returns the value of a static property
public boolean hasAnnotation( $annotation )
Checks whether the class is annotated with the annotation $annotation
public boolean hasConstant( $name )
Returns whether a constant exists or not
public boolean hasMethod( $name )
Returns whether a method exists or not
public boolean hasProperty( $name )
Returns whether a property exists or not
public boolean implementsInterface( $interface )
Returns whether this class implements a given interface
public boolean inNamespace( )
Returns whether this class is defined in a namespace
public boolean isAbstract( )
Returns whether this class is abstract
public boolean isFinal( )
Returns whether this class is final
public boolean isInstance( $object )
Returns whether the given object is an instance of this class
public boolean isInstantiable( )
Returns whether this class is instantiable
public boolean isInterface( )
Returns whether this class is an interface
public boolean isInternal( )
Returns whether this class is an internal class
public boolean isIterateable( )
Returns whether this class is iterateable (can be used inside foreach)
public boolean isSubclassOf( $class )
Returns whether this class is a subclass of another class
public boolean isUserDefined( )
Returns whether this class is user-defined
public object An newInstance( $arguments , $argument,... )
Returns an instance of this class
public object An newInstanceArgs( [ $arguments = null] )
Returns an instance of this class
public void setStaticPropertyValue( $name , $value , $default )
Sets the value of a static property
public mixed __call( $method , $arguments )
Use overloading to call additional methods of the ReflectionObject instance given to the constructor.
public string __toString( )
Returns a string representation

Inherited Methods

From ReflectionObject (Internal Class)
public ReflectionObject constructor __construct ( $argument )
public void export ( $argument, [$return = ] )
public void getConstant ( $name )
public void getConstants ( )
public void getConstructor ( )
public void getDefaultProperties ( )
public void getDocComment ( )
public void getEndLine ( )
public void getExtension ( )
public void getExtensionName ( )
public void getFileName ( )
public void getInterfaceNames ( )
public void getInterfaces ( )
public void getMethod ( $name )
public void getMethods ( [$filter = ] )
public void getModifiers ( )
public void getName ( )
public void getNamespaceName ( )
public void getParentClass ( )
public void getProperties ( [$filter = ] )
public void getProperty ( $name )
public void getShortName ( )
public void getStartLine ( )
public void getStaticProperties ( )
public void getStaticPropertyValue ( $name, [$default = ] )
public void hasConstant ( $name )
public void hasMethod ( $name )
public void hasProperty ( $name )
public void implementsInterface ( $interface )
public void inNamespace ( )
public void isAbstract ( )
public void isFinal ( )
public void isInstance ( $object )
public void isInstantiable ( )
public void isInterface ( )
public void isInternal ( )
public void isIterateable ( )
public void isSubclassOf ( $class )
public void isUserDefined ( )
public void newInstance ( $args )
public void newInstanceArgs ( [$args = ] )
public void setStaticPropertyValue ( $name, $value )
public void __clone ( )
public void __toString ( )

Methods

export

static mixed export( ReflectionObject $object , [boolean $return = false] )

Exports a ReflectionObject instance.

Returns the output if TRUE is specified for $return, printing it otherwise. This is purely a wrapper method, which calls the corresponding method of the parent class (ReflectionObject::export()).

Parameters:
Name Type Description
$object ReflectionObject ReflectionClass instance of the object
$return boolean Whether to return (TRUE) or print (FALSE) the output
Redefinition of:
Method Description
ReflectionObject::export ( $argument, [$return = ] )

__construct

ezcReflectionObject __construct( object|ReflectionObject $argument )

Constructs a new ezcReflectionObject.

Parameters:
Name Type Description
$argument object|ReflectionObject Instance or ReflectionObject of the object to be reflected
Redefinition of:
Method Description
ReflectionObject::constructor __construct ( $argument )

forwardCallToReflectionSource

mixed forwardCallToReflectionSource( string $method , [mixed[] $arguments = array()] )

Forwards a method invocation to either the reflection source passed to the constructor of this class when creating an instance or to the parent class.

This method is part of the dependency injection mechanism and serves as a helper for implementing wrapper methods without code duplication.

Parameters:
Name Type Description
$method string Name of the method to be invoked
$arguments mixed[] Arguments to be passed to the method

getAnnotations

ezcReflectionAnnotation[] getAnnotations( [string $name = ''] )

Returns an array of annotations (optinally only annotations of a given name)

Parameters:
Name Type Description
$name string Name of the annotations

getConstant

mixed getConstant( string $name )

Returns the class' constant specified by its name

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Parameters:
Name Type Description
$name string Name of the constant
Redefinition of:
Method Description
ReflectionObject::getConstant ( $name )

getConstants

array

Returns an associative array containing this class' constants and their values.

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::getConstants ( )

getConstructor

ezcReflectionMethod getConstructor( )

Returns an ezcReflectionMethod object of the constructor method.

Redefinition of:
Method Description
ReflectionObject::getConstructor ( )

getDefaultProperties

array

Returns an associative array containing copies of all default property values of the class.

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::getDefaultProperties ( )

getDocComment

string getDocComment( )

Returns the doc comment for the class.

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::getDocComment ( )

getEndLine

integer getEndLine( )

Returns the line this class' declaration ends at

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::getEndLine ( )

getExtension

ezcReflectionExtension getExtension( )

Returns NULL or the extension the class belongs to

Redefinition of:
Method Description
ReflectionObject::getExtension ( )

getExtensionName

string|boolean getExtensionName( )

Returns FALSE or the name of the extension the class belongs to

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::getExtensionName ( )

getFileName

string getFileName( )

Returns the filename of the file this class was declared in

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::getFileName ( )

getInterfaceNames

string[] getInterfaceNames( )

Returns an array of names of interfaces this class implements

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::getInterfaceNames ( )

getInterfaces

ezcReflectionClass[] getInterfaces( )

Returns an array of all interfaces implemented by the class.

Redefinition of:
Method Description
ReflectionObject::getInterfaces ( )

getLongDescription

string getLongDescription( )

Returns the long description of the class from the source code documentation

getMethod

ezcReflectionMethod getMethod( string $name )

Returns an ezcReflectionMethod object of the method specified by $name.

Parameters:
Name Type Description
$name string Name of the method
Exceptions:
Type Description
ReflectionException if method doesn't exist
Redefinition of:
Method Description
ReflectionObject::getMethod ( $name )

getMethods

ezcReflectionMethod[] getMethods( [integer $filter = -1] )

Returns the methods as an array of ezcReflectionMethod objects.

Parameters:
Name Type Description
$filter integer A combination of ReflectionMethod::IS_STATIC, ReflectionMethod::IS_PUBLIC, ReflectionMethod::IS_PROTECTED, ReflectionMethod::IS_PRIVATE, ReflectionMethod::IS_ABSTRACT and ReflectionMethod::IS_FINAL
Redefinition of:
Method Description
ReflectionObject::getMethods ( [$filter = ] )

getModifiers

integer getModifiers( )

Returns a bitfield of the access modifiers for this class

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::getModifiers ( )

getName

string getName( )

Returns the name of the class.

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::getName ( )

getNamespaceName

string getNamespaceName( )

Returns the name of namespace where this class is defined

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::getNamespaceName ( )

getParentClass

ezcReflectionClass|boolean getParentClass( )

Returns the class' parent class, or, if none exists, FALSE

Redefinition of:
Method Description
ReflectionObject::getParentClass ( )

getProperties

ezcReflectionProperty[] getProperties( [integer $filter = -1] )

Returns an array of this class' properties

Parameters:
Name Type Description
$filter integer A combination of ReflectionProperty::IS_STATIC, ReflectionProperty::IS_PUBLIC, ReflectionProperty::IS_PROTECTED and ReflectionProperty::IS_PRIVATE
Redefinition of:
Method Description
ReflectionObject::getProperties ( [$filter = ] )

getProperty

ezcReflectionProperty getProperty( string $name )

Returns the class' property specified by its name

Parameters:
Name Type Description
$name string Name of the property
Exceptions:
Type Description
RelectionException if property doesn't exist
Redefinition of:
Method Description
ReflectionObject::getProperty ( $name )

getShortDescription

string getShortDescription( )

Returns the short description of the class from the source code documentation

getShortName

string getShortName( )

Returns the short name of the class (without namespace part)

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::getShortName ( )

getStartLine

integer getStartLine( )

Returns the line this class' declaration starts at

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::getStartLine ( )

getStaticProperties

array getStaticProperties( )

Returns an associative array containing all static property values of the class

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::getStaticProperties ( )

getStaticPropertyValue

mixed getStaticPropertyValue( string $name , [mixed $default = null] )

Returns the value of a static property

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Parameters:
Name Type Description
$name string Name of the static property
$default mixed Default value
Redefinition of:
Method Description
ReflectionObject::getStaticPropertyValue ( $name, [$default = ] )

hasAnnotation

boolean hasAnnotation( string $annotation )

Checks whether the class is annotated with the annotation $annotation

Parameters:
Name Type Description
$annotation string Name of the annotation

hasConstant

boolean hasConstant( string $name )

Returns whether a constant exists or not

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Parameters:
Name Type Description
$name string Name of the constant
Redefinition of:
Method Description
ReflectionObject::hasConstant ( $name )

hasMethod

boolean hasMethod( string $name )

Returns whether a method exists or not

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Parameters:
Name Type Description
$name string Name of the method
Redefinition of:
Method Description
ReflectionObject::hasMethod ( $name )

hasProperty

boolean hasProperty( string $name )

Returns whether a property exists or not

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Parameters:
Name Type Description
$name string Name of the property
Redefinition of:
Method Description
ReflectionObject::hasProperty ( $name )

implementsInterface

boolean implementsInterface( string|ReflectionClass $interface )

Returns whether this class implements a given interface

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Parameters:
Name Type Description
$interface string|ReflectionClass Name or ReflectionClass object of the interface
Redefinition of:
Method Description
ReflectionObject::implementsInterface ( $interface )

inNamespace

boolean inNamespace( )

Returns whether this class is defined in a namespace

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::inNamespace ( )

isAbstract

boolean isAbstract( )

Returns whether this class is abstract

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::isAbstract ( )

isFinal

boolean isFinal( )

Returns whether this class is final

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::isFinal ( )

isInstance

boolean isInstance( object $object )

Returns whether the given object is an instance of this class

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Parameters:
Name Type Description
$object object An object to be checked
Redefinition of:
Method Description
ReflectionObject::isInstance ( $object )

isInstantiable

boolean isInstantiable( )

Returns whether this class is instantiable

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::isInstantiable ( )

isInterface

boolean isInterface( )

Returns whether this class is an interface

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::isInterface ( )

isInternal

boolean isInternal( )

Returns whether this class is an internal class

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::isInternal ( )

isIterateable

boolean isIterateable( )

Returns whether this class is iterateable (can be used inside foreach)

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::isIterateable ( )

isSubclassOf

boolean isSubclassOf( string|ReflectionClass $class )

Returns whether this class is a subclass of another class

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Parameters:
Name Type Description
$class string|ReflectionClass Name or ReflectionClass object of the super class
Redefinition of:
Method Description
ReflectionObject::isSubclassOf ( $class )

isUserDefined

boolean isUserDefined( )

Returns whether this class is user-defined

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::isUserDefined ( )

newInstance

object An newInstance( $arguments , mixed $argument,... )

Returns an instance of this class

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Parameters:
Name Type Description
$argument,... mixed Arguments
$arguments
Redefinition of:
Method Description
ReflectionObject::newInstance ( $args )

newInstanceArgs

object An newInstanceArgs( [ $arguments = null] )

Returns an instance of this class

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Parameters:
Name Type Description
$arguments array Arguments
Redefinition of:
Method Description
ReflectionObject::newInstanceArgs ( [$args = ] )

setStaticPropertyValue

void setStaticPropertyValue( string $name , $value , mixed $default )

Sets the value of a static property

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Parameters:
Name Type Description
$name string Name of the static property
$default mixed Value
$value
Redefinition of:
Method Description
ReflectionObject::setStaticPropertyValue ( $name, $value )

__call

mixed __call( string $method , array $arguments )

Use overloading to call additional methods of the ReflectionObject instance given to the constructor.

Parameters:
Name Type Description
$method string Method to be called
$arguments array Arguments that were passed

__toString

string __toString( )

Returns a string representation

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionObject::__toString ( )
Documentation generated by phpDocumentor 1.4.3