Extends the ReflectionProperty class to provide type information using PHPDoc annotations.
Source for this file: /Reflection/src/property.php
ReflectionProperty | --ezcReflectionProperty
Version: | //autogen// |
From ReflectionProperty (Internal Class): | |
---|---|
IS_PRIVATE = 1024
|
|
IS_PROTECTED = 512
|
|
IS_PUBLIC = 256
|
|
IS_STATIC = 1
|
protected ezcReflectionDocCommentParser |
$docParser
|
protected ReflectionProperty |
$reflectionSource
|
From ReflectionProperty (Internal Class) | |
---|---|
public |
$class
|
public |
$name
|
public static mixed |
export(
$class
, $property
, [ $return
= false] )
Exports a ReflectionProperty instance. |
public ezcReflectionProperty |
__construct(
$class
, [ $name
= null] )
Constructs a new ezcReflectionProperty object |
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 ezcReflectionClass |
getDeclaringClass(
)
Returns the declaring class. |
public string |
getDocComment(
)
Returns the PHPDoc comment of the property. |
public int |
getModifiers(
)
Returns a bitfield of the access modifiers for this property. |
public string |
getName(
)
Returns the name of the property. |
public ezcReflectionType |
getType(
)
Determines the type of the property based on source code annotations. |
public mixed |
getValue(
[ $object
= null] )
Returns the property's value. |
public boolean |
hasAnnotation(
$annotation
)
Checks whether the property is annotated with the annotation $annotation |
public bool |
isDefault(
)
Returns whether the property is a default property defined in the class. |
public bool |
isPrivate(
)
Returns true if this property has private as access level. |
public bool |
isProtected(
)
Returns true if this property has protected as access level. |
public bool |
isPublic(
)
Returns true if this property has public as access level. |
public bool |
isStatic(
)
Returns true if this property has is a static property. |
public void |
setAccessible(
$value
)
Sets whether non-public properties can be requested |
public void |
setValue(
$object
, [ $value
= null] )
Changes the property's value. |
public mixed |
__call(
$method
, $arguments
)
Use overloading to call additional methods of the ReflectionProperty instance given to the constructor. |
public string |
__toString(
)
Returns a string representation |
From ReflectionProperty (Internal Class) | |
---|---|
public ReflectionProperty |
constructor __construct ( $class, $name )
|
public void |
export ( $class, $name, [$return = ] )
|
public void |
getDeclaringClass ( )
|
public void |
getDocComment ( )
|
public void |
getModifiers ( )
|
public void |
getName ( )
|
public void |
getValue ( [$object = ] )
|
public void |
isDefault ( )
|
public void |
isPrivate ( )
|
public void |
isProtected ( )
|
public void |
isPublic ( )
|
public void |
isStatic ( )
|
public void |
setAccessible ( $visible )
|
public void |
setValue ( $object, [$value = ] )
|
public void |
__clone ( )
|
public void |
__toString ( )
|
Exports a ReflectionProperty 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.
Name | Type | Description |
---|---|---|
$class |
ReflectionClass|string | ReflectionClass object or name of the class |
$property |
ReflectionProperty|string | ReflectionProperty object or name of the class |
$return |
boolean | Whether to return (TRUE) or print (FALSE) the output |
Method | Description |
---|---|
ReflectionProperty::export ( $class, $name, [$return = ] ) |
Constructs a new ezcReflectionProperty object
Throws an Exception in case the given property does not exist
Name | Type | Description |
---|---|---|
$class |
string|object|ReflectionProperty | Name, instance of the property's class or ReflectionProperty object of the property |
$name |
string | Name of the property to be reflected. Can be null or will be ignored if a ReflectionProperty object is given as first parameter. |
Method | Description |
---|---|
ReflectionProperty::constructor __construct ( $class, $name ) |
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.
Name | Type | Description |
---|---|---|
$method |
string | Name of the method to be invoked |
$arguments |
mixed[] | Arguments to be passed to the method |
Returns an array of annotations (optinally only annotations of a given name)
Name | Type | Description |
---|---|---|
$name |
string | Name of the annotations |
Returns the declaring class.
Method | Description |
---|---|
ReflectionProperty::getDeclaringClass ( ) |
Returns the PHPDoc comment of the property.
Method | Description |
---|---|
ReflectionProperty::getDocComment ( ) |
Returns a bitfield of the access modifiers for this property.
Method | Description |
---|---|
ReflectionProperty::getModifiers ( ) |
Returns the name of the property.
Method | Description |
---|---|
ReflectionProperty::getName ( ) |
Determines the type of the property based on source code annotations.
Returns the property's value.
Name | Type | Description |
---|---|---|
$object |
object | An object from which the property value is obtained |
Method | Description |
---|---|
ReflectionProperty::getValue ( [$object = ] ) |
Checks whether the property is annotated with the annotation $annotation
Name | Type | Description |
---|---|---|
$annotation |
string | Name of the annotation |
Returns whether the property is a default property defined in the class.
A default property is defined in the class definition. A non-default property is an instance specific state.
Method | Description |
---|---|
ReflectionProperty::isDefault ( ) |
Returns true if this property has private as access level.
Method | Description |
---|---|
ReflectionProperty::isPrivate ( ) |
Returns true if this property has protected as access level.
Method | Description |
---|---|
ReflectionProperty::isProtected ( ) |
Returns true if this property has public as access level.
Method | Description |
---|---|
ReflectionProperty::isPublic ( ) |
Returns true if this property has is a static property.
Method | Description |
---|---|
ReflectionProperty::isStatic ( ) |
Sets whether non-public properties can be requested
Name | Type | Description |
---|---|---|
$value |
boolean | Whether non-public properties can be requested |
Method | Description |
---|---|
ReflectionProperty::setAccessible ( $visible ) |
Changes the property's value.
Name | Type | Description |
---|---|---|
$object |
object | An object on which the property value will be changed |
$value |
mixed | Value of the property |
Method | Description |
---|---|
ReflectionProperty::setValue ( $object, [$value = ] ) |
Use overloading to call additional methods of the ReflectionProperty instance given to the constructor.
Name | Type | Description |
---|---|---|
$method |
string | Method to be called |
$arguments |
array | Arguments that were passed |
Returns a string representation
Method | Description |
---|---|
ReflectionProperty::__toString ( ) |