Annotations\Collection

Class Phalcon\Annotations\Collection

implements Iterator, Traversable, Countable

Represents a collection of annotations. This class allows to traverse a group of annotations easily

//Traverse annotations
 foreach ($classAnnotations as $annotation) {
     echo 'Name=', $annotation->getName(), PHP_EOL;
 }

 //Check if the annotations has a specific
 var_dump($classAnnotations->has('Cacheable'));

 //Get an specific annotation in the collection
 $annotation = $classAnnotations->get('Cacheable');

Methods

public __construct ([array $reflectionData])

Phalcon\Annotations\Collection constructor

public int count ()

Returns the number of annotations in the collectio