Beispiel #1
0
 /**
  * Gets all annotations
  *
  * @param  [type] $entity [description]
  * @return [type] [description]
  */
 public function all($entity)
 {
     $reflectionClass = new \ReflectionClass($entity);
     $properties = $reflectionClass->getProperties();
     $class = new \ReflectionClass($entity);
     while ($parent = $class->getParentClass()) {
         $parentProperties = $parent->getProperties();
         $properties = array_merge($parentProperties, $properties);
         $class = $parent;
     }
     $return = array();
     foreach ($properties as $reflectionProperty) {
         $propertyAnnotation = $this->reader->getPropertyAnnotation($reflectionProperty, $this->annotationClass);
         if (!is_null($propertyAnnotation) && $propertyAnnotation->listable) {
             $return[] = array('property' => $reflectionProperty->name, 'type' => $propertyAnnotation->type);
         }
     }
     return $return;
 }