Beispiel #1
0
 /**
  * @param $class                   Reflection_Class
  * @param $composite_class_name    string
  * @return Reflection_Property_Value[]
  */
 protected function getProperties(Reflection_Class $class, $composite_class_name = null)
 {
     $properties = [];
     if (isset($composite_class_name) && isA($class->name, Component::class)) {
         $composite_property = call_user_func([$class->name, 'getCompositeProperties'], $composite_class_name);
         $composite_property = reset($composite_property);
     } else {
         $composite_property = null;
     }
     if ($class->getAnnotation('link')->value) {
         $link_class = new Link_Class($class->name);
         $composite_link_property = $link_class->getCompositeProperty();
         foreach ($link_class->getProperties([T_EXTENDS, T_USE]) as $property) {
             if ((!$composite_property || $property->name !== $composite_property->name) && (!$composite_link_property || $property->name !== $composite_link_property->name) && !$property->isStatic() && !$property->getListAnnotation('user')->has(User_Annotation::INVISIBLE)) {
                 $properties[] = $property;
             }
         }
     } else {
         foreach ($class->getProperties([T_EXTENDS, T_USE]) as $property) {
             if ((empty($composite_property) || $property->name !== $composite_property->name) && !$property->isStatic() && !$property->getListAnnotation('user')->has(User_Annotation::INVISIBLE)) {
                 $properties[] = $property;
             }
         }
     }
     return $properties;
 }
Beispiel #2
0
 /**
  * Adds properties of the class name into $properties
  *
  * Please always call this instead of adding properties manually : it manages 'link'
  * class annotations.
  *
  * @param $path       string
  * @param $class_name string
  * @param $join_mode  string
  */
 private function addProperties($path, $class_name, $join_mode = null)
 {
     $class = new Link_Class($class_name);
     $this->properties[$class_name] = $class->getProperties([T_EXTENDS, T_USE]);
     $linked_class_name = $class->getAnnotation('link')->value;
     if ($linked_class_name) {
         $this->addLinkedClass($path, $class, $linked_class_name, $join_mode);
     }
 }