Beispiel #1
0
 public static function getGeneralAttribute($id = null, $class_name = null)
 {
     if (is_null($id)) {
         return false;
     }
     if (is_null($class_name)) {
         $defifnition = self::$un_definition;
         $t_instance = self::getObjectById($id);
     } else {
         $defifnition = $class_name::$un_definition;
         $t_instance = $class_name::getObjectById($id);
     }
     if (array_key_exists('general_attribute', $defifnition) && !($defifnition['general_attribute'] == '')) {
         if (array_key_exists($defifnition['general_attribute'], $defifnition['fields'])) {
             return UN_ObjectModel::getFieldValue($t_instance, $defifnition['general_attribute'], $defifnition['class_name']);
         } else {
             die('general_attribute "' . $defifnition['general_attribute'] . '" defined in class "' . $defifnition['class_name'] . '" not found in class fields');
         }
     } else {
         die('"general_attribute" array not defined in class "' . $defifnition['class_name'] . '" or atttribute name is empty');
     }
 }