Class Phalcon\Annotations\Reflection

Allows to manipulate the annotations reflection in an OO manner

  1. <?php
  2. //Parse the annotations in a class
  3. $reader = new \Phalcon\Annotations\Reader();
  4. $parsing = reader->parse('MyComponent');
  5. //Create the reflection
  6. $reflection = new \Phalcon\Annotations\Reflection($parsing);
  7. //Get the annotations in the class docblock
  8. $classAnnotations = reflection->getClassAnnotations();

Methods

public __construct ([unknown $reflectionData])

Phalcon\Annotations\Reflection constructor

public Phalcon\Annotations\Collection |false getClassAnnotations ()

Returns the annotations found in the class docblock

public Phalcon\Annotations\Collection [] getMethodsAnnotations ()

Returns the annotations found in the methods’ docblocks

public Phalcon\Annotations\Collection [] getPropertiesAnnotations ()

Returns the annotations found in the properties’ docblocks

public array getReflectionData ()

Returns the raw parsing intermediate definitions used to construct the reflection

public static array data __set_state (unknown $data)

Restores the state of a Phalcon\Annotations\Reflection variable export