Beispiel #1
0
 /**
  * Returns a value with application of current locales
  *
  * @param $template Template
  * @return object
  */
 public function getLoc(Template $template)
 {
     foreach ($template->objects as $object) {
         if (is_object($object)) {
             if ($object instanceof Date_Time) {
                 return Loc::dateToLocale($object);
             } else {
                 $property_name = reset($template->var_names);
                 if (method_exists(get_class($object), $property_name)) {
                     $method = new Reflection_Method(get_class($object), $property_name);
                     return Loc::methodToLocale($method, reset($template->objects));
                 } else {
                     $property = new Reflection_Property(get_class($object), $property_name);
                     return Loc::propertyToLocale($property, reset($template->objects));
                 }
             }
             break;
         }
     }
     return reset($object);
 }