Example #1
0
 /**
  * Returns object's properties, and their display and value
  *
  * @param $template Template
  * @return Reflection_Property_Value[]
  */
 public function getProperties(Template $template)
 {
     $object = reset($template->objects);
     $properties_filter = $template->getParameter(Parameter::PROPERTIES_FILTER);
     $class = new Reflection_Class(get_class($object));
     $result_properties = [];
     foreach ($class->accessProperties() as $property_name => $property) {
         if (!$property->isStatic() && !$property->getListAnnotation('user')->has(User_Annotation::INVISIBLE)) {
             if (!isset($properties_filter) || in_array($property_name, $properties_filter)) {
                 $property = new Reflection_Property_Value($property->class, $property->name, $object, false, true);
                 $property->final_class = $class->name;
                 $result_properties[$property_name] = $property;
             }
         }
     }
     return Replaces_Annotations::removeReplacedProperties($result_properties);
 }