Zend Framework  3.0
Public Member Functions | Protected Attributes | List of all members
DoctrineAnnotationParser Class Reference

A parser for docblock annotations that utilizes the annotation parser from Doctrine. More...

Public Member Functions

 __construct ()
 
 setDocParser (DocParser $docParser)
 Set the DocParser instance.
 
 getDocParser ()
 Retrieve the DocParser instance.
 
 onCreateAnnotation (EventInterface $e)
 Handle annotation creation.
 
 registerAnnotation ($annotation)
 Specify an allowed annotation class.
 
 registerAnnotations ($annotations)
 Set many allowed annotations at once.
 

Protected Attributes

 $allowedAnnotations = []
 
 $docParser
 

Detailed Description

A parser for docblock annotations that utilizes the annotation parser from Doctrine.

Consumes Doctrine, and responds to events from AnnotationManager. If the annotation examined is in the list of classes we are interested in, the raw annotation is passed to the DocParser in order to retrieve the annotation object instance. Otherwise, it is skipped.

Constructor & Destructor Documentation

__construct ( )

Member Function Documentation

getDocParser ( )

Retrieve the DocParser instance.

If none is registered, lazy-loads a new instance.

Returns
DocParser
onCreateAnnotation ( EventInterface  $e)

Handle annotation creation.

Parameters
EventInterface$e
Returns
false|

Implements ParserInterface.

registerAnnotation (   $annotation)

Specify an allowed annotation class.

Parameters
string$annotation
Returns
DoctrineAnnotationParser

Implements ParserInterface.

registerAnnotations (   $annotations)

Set many allowed annotations at once.

Parameters
array | Traversable$annotationsArray or traversable object of annotation class names
Exceptions
Exception\InvalidArgumentException
Returns
DoctrineAnnotationParser

Implements ParserInterface.

setDocParser ( DocParser  $docParser)

Set the DocParser instance.

Parameters
DocParser$docParser
Returns
DoctrineAnnotationParser

Member Data Documentation

$allowedAnnotations = []
protected
$docParser
protected