Exemplo n.º 1
0
 /**
  * @param      $class
  * @param      $parameters
  * @param bool $targetReflection
  *
  * @return bool|object
  */
 public function instantiateAnnotation($class, $parameters, $targetReflection = false)
 {
     $class = RokCommon_Annotation_Addendum::resolveClassName($class);
     if (is_subclass_of($class, 'RokCommon_Annotation') && !RokCommon_Annotation_Addendum::ignores($class) || $class == 'RokCommon_Annotation') {
         $annotationReflection = new ReflectionClass($class);
         return $annotationReflection->newInstance($parameters, $targetReflection);
     }
     return false;
 }
Exemplo n.º 2
0
 /**
  * @param bool $restriction
  *
  * @return array
  */
 public function getAllAnnotations($restriction = false)
 {
     $restriction = RokCommon_Annotation_Addendum::resolveClassName($restriction);
     $result = array();
     foreach ($this->annotations as $class => $instances) {
         if (!$restriction || $restriction == $class) {
             $result = array_merge($result, $instances);
         }
     }
     return $result;
 }