25 'attribute' =>
'attr',
26 'enterprise' =>
'ent',
30 'notification' =>
'ntfc',
35 'datetime' =>
'dtime',
54 'agreement' =>
'agrt',
58 'downloadable' =>
'dl',
62 'newsletter' =>
'nlttr',
64 'calculation' =>
'calc',
77 return strtr(
$name, self::$_translateMap);
89 self::$_translateMap[$from] = $to;
102 if (strlen($entityName) > self::MYSQL_IDENTIFIER_LEN) {
104 if (strlen($shortName) > self::MYSQL_IDENTIFIER_LEN) {
105 $hash = md5($entityName);
106 if (strlen(
$prefix . $hash) > self::MYSQL_IDENTIFIER_LEN) {
107 $entityName = self::trimHash($hash,
$prefix, self::MYSQL_IDENTIFIER_LEN);
112 $entityName = $shortName;
126 private static function trimHash($hash,
$prefix, $maxCharacters)
128 $diff = strlen($hash) + strlen(
$prefix) - $maxCharacters;
129 $superfluous = $diff / 2;
131 $hash = substr($hash, $superfluous, - ($superfluous + $odd));
static shortenEntityName($entityName, $prefix)
const MYSQL_IDENTIFIER_LEN
static addTranslate($from, $to)
if(!isset($_GET['name'])) $name