rewrite tablePrefixAlias
This commit is contained in:
parent
ebc996c820
commit
fb5f76f025
1 changed files with 1 additions and 4 deletions
|
@ -291,10 +291,7 @@ class SqlWalker implements TreeWalker
|
||||||
$tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : '';
|
$tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : '';
|
||||||
|
|
||||||
if ( ! isset($this->tableAliasMap[$tableName])) {
|
if ( ! isset($this->tableAliasMap[$tableName])) {
|
||||||
$tablePrefixAlias = strtolower(substr($tableName, 0, 1));
|
$tablePrefixAlias = preg_match('~[a-z]~i', $tableName[0]) ? strtolower($tableName[0]) : 't';
|
||||||
if( ! preg_match("/[a-z]/", $tablePrefixAlias)) {
|
|
||||||
$tablePrefixAlias = 't';
|
|
||||||
}
|
|
||||||
$this->tableAliasMap[$tableName] = $tablePrefixAlias . $this->tableAliasCounter++ . '_';
|
$this->tableAliasMap[$tableName] = $tablePrefixAlias . $this->tableAliasCounter++ . '_';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue