1
0
mirror of synced 2025-01-18 22:41:43 +03:00

rewrite tablePrefixAlias

This commit is contained in:
Mike Meier 2013-03-15 14:19:41 +01:00 committed by Marco Pivetta
parent ebc996c820
commit fb5f76f025

View File

@ -291,10 +291,7 @@ class SqlWalker implements TreeWalker
$tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : '';
if ( ! isset($this->tableAliasMap[$tableName])) {
$tablePrefixAlias = strtolower(substr($tableName, 0, 1));
if( ! preg_match("/[a-z]/", $tablePrefixAlias)) {
$tablePrefixAlias = 't';
}
$tablePrefixAlias = preg_match('~[a-z]~i', $tableName[0]) ? strtolower($tableName[0]) : 't';
$this->tableAliasMap[$tableName] = $tablePrefixAlias . $this->tableAliasCounter++ . '_';
}