/** * Returns the short attribute name (alias) if it's defined, given attribute name otherwise * * @param eZDBInterface $db * @param array $def A definition array of all fields, table name and sorting (see {@link eZPersistentObject::definition()} for more info) * @param string $attrName * @return string */ public static function getShortAttributeName($db, $def, $attrName) { $fields = $def['fields']; if ($db->useShortNames() && isset($fields[$attrName]) && array_key_exists('short_name', $fields[$attrName]) && $fields[$attrName]['short_name']) { return $fields[$attrName]['short_name']; } return $attrName; }