Beispiel #1
0
 /**
  * @param $constants string[] key is the property path (can be translated or alias)
  */
 public function setConstants($constants)
 {
     $class_name = $this->getClassName();
     $properties_alias = Import_Array::getPropertiesAlias($class_name);
     $use_reverse_translation = Locale::current() ? true : false;
     foreach ($constants as $property_path => $value) {
         $property_path = Import_Array::propertyPathOf($class_name, $property_path, $use_reverse_translation, $properties_alias);
         $property_name = ($i = strrpos($property_path, DOT)) === false ? $property_path : substr($property_path, $i + 1);
         $master_path = substr($property_path, 0, $i);
         if (isset($this->classes[$master_path])) {
             $this->classes[$master_path]->constants[$property_name] = new Reflection_Property_Value($this->classes[$master_path]->class_name, $property_name, $value, true);
         }
     }
 }