2009-01-19 21:40:12 +03:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* To change this template, choose Tools | Templates
|
|
|
|
* and open the template in the editor.
|
|
|
|
*/
|
|
|
|
|
2009-01-22 22:38:10 +03:00
|
|
|
namespace Doctrine\ORM\Query;
|
|
|
|
|
|
|
|
use Doctrine\ORM\Query\AST;
|
|
|
|
|
2009-01-19 21:40:12 +03:00
|
|
|
/**
|
2009-02-05 20:34:44 +03:00
|
|
|
* The SqlWalker walks over an AST that represents a DQL query and constructs
|
|
|
|
* the corresponding SQL. The walking can start at any node, not only at some root
|
|
|
|
* node. Therefore it is possible to only generate SQL parts by simply walking over
|
|
|
|
* certain subtrees of the AST.
|
2009-01-19 21:40:12 +03:00
|
|
|
*
|
|
|
|
* @author robo
|
2009-02-05 20:34:44 +03:00
|
|
|
* @since 2.0
|
2009-01-19 21:40:12 +03:00
|
|
|
*/
|
2009-01-22 22:38:10 +03:00
|
|
|
class SqlWalker
|
2009-01-19 21:40:12 +03:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* A simple array keys representing table aliases and values table alias
|
|
|
|
* seeds. The seeds are used for generating short SQL table aliases.
|
|
|
|
*
|
|
|
|
* @var array $_tableAliasSeeds
|
|
|
|
*/
|
|
|
|
private $_tableAliasSeeds = array();
|
|
|
|
private $_parserResult;
|
|
|
|
private $_em;
|
|
|
|
private $_dqlToSqlAliasMap = array();
|
|
|
|
private $_scalarAliasCounter = 0;
|
|
|
|
|
2009-02-05 20:34:44 +03:00
|
|
|
/**
|
|
|
|
* Initializes a new SqlWalker instance.
|
|
|
|
*/
|
2009-01-19 21:40:12 +03:00
|
|
|
public function __construct($em, $parserResult)
|
|
|
|
{
|
|
|
|
$this->_em = $em;
|
|
|
|
$this->_parserResult = $parserResult;
|
|
|
|
$sqlToDqlAliasMap = array();
|
|
|
|
foreach ($parserResult->getQueryComponents() as $dqlAlias => $qComp) {
|
|
|
|
if ($dqlAlias != 'dctrn') {
|
2009-01-22 22:38:10 +03:00
|
|
|
$sqlAlias = $this->generateTableAlias($qComp['metadata']->getTableName());
|
2009-01-19 21:40:12 +03:00
|
|
|
$sqlToDqlAliasMap[$sqlAlias] = $dqlAlias;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// SQL => DQL alias stored in ParserResult, needed for hydration.
|
|
|
|
$parserResult->setTableAliasMap($sqlToDqlAliasMap);
|
|
|
|
// DQL => SQL alias stored only locally, needed for SQL construction.
|
|
|
|
$this->_dqlToSqlAliasMap = array_flip($sqlToDqlAliasMap);
|
|
|
|
}
|
|
|
|
|
2009-01-22 22:38:10 +03:00
|
|
|
public function walkSelectStatement(AST\SelectStatement $AST)
|
2009-01-19 21:40:12 +03:00
|
|
|
{
|
|
|
|
$sql = $this->walkSelectClause($AST->getSelectClause());
|
|
|
|
$sql .= $this->walkFromClause($AST->getFromClause());
|
2009-01-20 20:07:07 +03:00
|
|
|
$sql .= $AST->getWhereClause() ? $this->walkWhereClause($AST->getWhereClause()) : '';
|
2009-01-19 21:40:12 +03:00
|
|
|
$sql .= $AST->getGroupByClause() ? $this->walkGroupByClause($AST->getGroupByClause()) : '';
|
2009-01-20 20:07:07 +03:00
|
|
|
|
2009-01-19 21:40:12 +03:00
|
|
|
//... more clauses
|
|
|
|
return $sql;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function walkSelectClause($selectClause)
|
|
|
|
{
|
|
|
|
return 'SELECT ' . (($selectClause->isDistinct()) ? 'DISTINCT ' : '')
|
|
|
|
. implode(', ', array_map(array(&$this, 'walkSelectExpression'),
|
|
|
|
$selectClause->getSelectExpressions()));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function walkFromClause($fromClause)
|
|
|
|
{
|
|
|
|
$sql = ' FROM ';
|
|
|
|
$identificationVarDecls = $fromClause->getIdentificationVariableDeclarations();
|
|
|
|
$firstIdentificationVarDecl = $identificationVarDecls[0];
|
|
|
|
$rangeDecl = $firstIdentificationVarDecl->getRangeVariableDeclaration();
|
|
|
|
$sql .= $rangeDecl->getClassMetadata()->getTableName() . ' '
|
|
|
|
. $this->_dqlToSqlAliasMap[$rangeDecl->getAliasIdentificationVariable()];
|
|
|
|
|
|
|
|
foreach ($firstIdentificationVarDecl->getJoinVariableDeclarations() as $joinVarDecl) {
|
|
|
|
$sql .= $this->walkJoinVariableDeclaration($joinVarDecl);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $sql;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Walks down a JoinVariableDeclaration AST node and creates the corresponding SQL.
|
|
|
|
*
|
|
|
|
* @param JoinVariableDeclaration $joinVarDecl
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function walkJoinVariableDeclaration($joinVarDecl)
|
|
|
|
{
|
|
|
|
$join = $joinVarDecl->getJoin();
|
|
|
|
$joinType = $join->getJoinType();
|
2009-01-22 22:38:10 +03:00
|
|
|
if ($joinType == AST\Join::JOIN_TYPE_LEFT ||
|
|
|
|
$joinType == AST\Join::JOIN_TYPE_LEFTOUTER) {
|
2009-01-19 21:40:12 +03:00
|
|
|
$sql = ' LEFT JOIN ';
|
|
|
|
} else {
|
|
|
|
$sql = ' INNER JOIN ';
|
|
|
|
}
|
|
|
|
|
|
|
|
$joinAssocPathExpr = $join->getJoinAssociationPathExpression();
|
|
|
|
$sourceQComp = $this->_parserResult->getQueryComponent($joinAssocPathExpr->getIdentificationVariable());
|
|
|
|
$targetQComp = $this->_parserResult->getQueryComponent($join->getAliasIdentificationVariable());
|
|
|
|
$targetTableName = $targetQComp['metadata']->getTableName();
|
|
|
|
$targetTableAlias = $this->_dqlToSqlAliasMap[$join->getAliasIdentificationVariable()];
|
|
|
|
$sourceTableAlias = $this->_dqlToSqlAliasMap[$joinAssocPathExpr->getIdentificationVariable()];
|
|
|
|
|
|
|
|
$sql .= $targetTableName . ' ' . $targetTableAlias . ' ON ';
|
|
|
|
|
|
|
|
if ( ! $targetQComp['relation']->isOwningSide()) {
|
|
|
|
$assoc = $targetQComp['metadata']->getAssociationMapping($targetQComp['relation']->getMappedByFieldName());
|
|
|
|
} else {
|
|
|
|
$assoc = $targetQComp['relation'];
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($targetQComp['relation']->isOneToOne() || $targetQComp['relation']->isOneToMany()) {
|
|
|
|
$joinColumns = $assoc->getSourceToTargetKeyColumns();
|
|
|
|
$first = true;
|
|
|
|
foreach ($joinColumns as $sourceColumn => $targetColumn) {
|
|
|
|
if ( ! $first) $sql .= ' AND ';
|
|
|
|
if ($targetQComp['relation']->isOwningSide()) {
|
|
|
|
$sql .= "$sourceTableAlias.$sourceColumn = $targetTableAlias.$targetColumn";
|
|
|
|
} else {
|
|
|
|
$sql .= "$sourceTableAlias.$targetColumn = $targetTableAlias.$sourceColumn";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else { // ManyToMany
|
|
|
|
//TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
return $sql;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Walks down a SelectExpression AST node and generates the corresponding SQL.
|
|
|
|
*
|
|
|
|
* @param <type> $selectExpression
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function walkSelectExpression($selectExpression)
|
|
|
|
{
|
|
|
|
$sql = '';
|
2009-01-22 22:38:10 +03:00
|
|
|
if ($selectExpression->getExpression() instanceof AST\PathExpression) {
|
2009-01-19 21:40:12 +03:00
|
|
|
$pathExpression = $selectExpression->getExpression();
|
|
|
|
if ($pathExpression->isSimpleStateFieldPathExpression()) {
|
|
|
|
$parts = $pathExpression->getParts();
|
|
|
|
$numParts = count($parts);
|
|
|
|
$dqlAlias = $parts[0];
|
|
|
|
$fieldName = $parts[$numParts-1];
|
|
|
|
$qComp = $this->_parserResult->getQueryComponent($dqlAlias);
|
|
|
|
$class = $qComp['metadata'];
|
|
|
|
|
|
|
|
if ($numParts > 2) {
|
|
|
|
for ($i = 1; $i < $numParts-1; ++$i) {
|
|
|
|
//TODO
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$sqlTableAlias = $this->_dqlToSqlAliasMap[$dqlAlias];
|
|
|
|
$sql .= $sqlTableAlias . '.' . $class->getColumnName($fieldName) .
|
|
|
|
' AS ' . $sqlTableAlias . '__' . $class->getColumnName($fieldName);
|
|
|
|
} else if ($pathExpression->isSimpleStateFieldAssociationPathExpression()) {
|
2009-02-05 20:34:44 +03:00
|
|
|
throw new DoctrineException("Not yet implemented.");
|
2009-01-19 21:40:12 +03:00
|
|
|
} else {
|
2009-02-05 20:34:44 +03:00
|
|
|
throw new DoctrineException("Encountered invalid PathExpression during SQL construction.");
|
2009-01-19 21:40:12 +03:00
|
|
|
}
|
|
|
|
}
|
2009-01-22 22:38:10 +03:00
|
|
|
else if ($selectExpression->getExpression() instanceof AST\AggregateExpression) {
|
2009-01-19 21:40:12 +03:00
|
|
|
$aggExpr = $selectExpression->getExpression();
|
|
|
|
|
|
|
|
if ( ! $selectExpression->getFieldIdentificationVariable()) {
|
|
|
|
$alias = $this->_scalarAliasCounter++;
|
|
|
|
} else {
|
|
|
|
$alias = $selectExpression->getFieldIdentificationVariable();
|
|
|
|
}
|
|
|
|
|
|
|
|
$parts = $aggExpr->getPathExpression()->getParts();
|
|
|
|
$dqlAlias = $parts[0];
|
|
|
|
$fieldName = $parts[1];
|
|
|
|
|
|
|
|
$qComp = $this->_parserResult->getQueryComponent($dqlAlias);
|
|
|
|
$columnName = $qComp['metadata']->getColumnName($fieldName);
|
|
|
|
|
|
|
|
$sql .= $aggExpr->getFunctionName() . '(';
|
2009-01-21 21:25:05 +03:00
|
|
|
if ($aggExpr->isDistinct()) $sql .= 'DISTINCT ';
|
2009-01-19 21:40:12 +03:00
|
|
|
$sql .= $this->_dqlToSqlAliasMap[$dqlAlias] . '.' . $columnName;
|
|
|
|
$sql .= ') AS dctrn__' . $alias;
|
|
|
|
}
|
|
|
|
//TODO: else if Subselect
|
|
|
|
else {
|
|
|
|
$dqlAlias = $selectExpression->getExpression();
|
|
|
|
$queryComp = $this->_parserResult->getQueryComponent($dqlAlias);
|
|
|
|
$class = $queryComp['metadata'];
|
|
|
|
|
|
|
|
$sqlTableAlias = $this->_dqlToSqlAliasMap[$dqlAlias];
|
|
|
|
$beginning = true;
|
|
|
|
foreach ($class->getFieldMappings() as $fieldName => $fieldMapping) {
|
|
|
|
if ($beginning) {
|
|
|
|
$beginning = false;
|
|
|
|
} else {
|
|
|
|
$sql .= ', ';
|
|
|
|
}
|
|
|
|
$sql .= $sqlTableAlias . '.' . $fieldMapping['columnName'] .
|
|
|
|
' AS ' . $sqlTableAlias . '__' . $fieldMapping['columnName'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $sql;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function walkGroupByClause($groupByClause)
|
|
|
|
{
|
|
|
|
return ' GROUP BY '
|
|
|
|
. implode(', ', array_map(array(&$this, 'walkGroupByItem'),
|
|
|
|
$groupByClause->getGroupByItems()));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function walkGroupByItem($pathExpr)
|
|
|
|
{
|
|
|
|
//TODO: support general SingleValuedPathExpression, not just state field
|
|
|
|
$parts = $pathExpr->getParts();
|
|
|
|
$qComp = $this->_parserResult->getQueryComponent($parts[0]);
|
|
|
|
$columnName = $qComp['metadata']->getColumnName($parts[1]);
|
|
|
|
return $this->_dqlToSqlAliasMap[$parts[0]] . '.' . $columnName;
|
|
|
|
}
|
|
|
|
|
2009-01-22 22:38:10 +03:00
|
|
|
public function walkUpdateStatement(AST\UpdateStatement $AST)
|
2009-01-19 21:40:12 +03:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2009-01-22 22:38:10 +03:00
|
|
|
public function walkDeleteStatement(AST\DeleteStatement $AST)
|
2009-01-19 21:40:12 +03:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2009-01-20 20:07:07 +03:00
|
|
|
public function walkWhereClause($whereClause)
|
|
|
|
{
|
|
|
|
$sql = ' WHERE ';
|
|
|
|
$condExpr = $whereClause->getConditionalExpression();
|
2009-01-21 21:25:05 +03:00
|
|
|
$sql .= implode(' OR ', array_map(array(&$this, 'walkConditionalTerm'),
|
|
|
|
$condExpr->getConditionalTerms()));
|
2009-01-20 20:07:07 +03:00
|
|
|
return $sql;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function walkConditionalTerm($condTerm)
|
|
|
|
{
|
2009-01-22 22:38:10 +03:00
|
|
|
return implode(' AND ', array_map(array(&$this, 'walkConditionalFactor'),
|
2009-01-21 21:25:05 +03:00
|
|
|
$condTerm->getConditionalFactors()));
|
2009-01-20 20:07:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public function walkConditionalFactor($factor)
|
|
|
|
{
|
|
|
|
$sql = '';
|
|
|
|
if ($factor->isNot()) $sql .= ' NOT ';
|
|
|
|
$primary = $factor->getConditionalPrimary();
|
|
|
|
if ($primary->isSimpleConditionalExpression()) {
|
|
|
|
$simpleCond = $primary->getSimpleConditionalExpression();
|
2009-01-22 22:38:10 +03:00
|
|
|
if ($simpleCond instanceof AST\ComparisonExpression) {
|
2009-01-20 20:07:07 +03:00
|
|
|
$sql .= $this->walkComparisonExpression($simpleCond);
|
|
|
|
}
|
2009-01-22 22:38:10 +03:00
|
|
|
else if ($simpleCond instanceof AST\LikeExpression) {
|
2009-01-21 21:25:05 +03:00
|
|
|
$sql .= $this->walkLikeExpression($simpleCond);
|
|
|
|
}
|
2009-01-20 20:07:07 +03:00
|
|
|
// else if ...
|
2009-01-21 21:25:05 +03:00
|
|
|
} else if ($primary->isConditionalExpression()) {
|
|
|
|
$sql .= '(' . implode(' OR ', array_map(array(&$this, 'walkConditionalTerm'),
|
|
|
|
$primary->getConditionalExpression()->getConditionalTerms())) . ')';
|
2009-01-20 20:07:07 +03:00
|
|
|
}
|
2009-01-21 21:25:05 +03:00
|
|
|
return $sql;
|
|
|
|
}
|
2009-01-20 20:07:07 +03:00
|
|
|
|
2009-01-21 21:25:05 +03:00
|
|
|
public function walkLikeExpression($likeExpr)
|
|
|
|
{
|
|
|
|
$sql = '';
|
|
|
|
$stringExpr = $likeExpr->getStringExpression();
|
2009-01-22 22:38:10 +03:00
|
|
|
if ($stringExpr instanceof AST\PathExpression) {
|
2009-01-21 21:25:05 +03:00
|
|
|
$sql .= $this->walkPathExpression($stringExpr);
|
|
|
|
} //TODO else...
|
|
|
|
$sql .= ' LIKE ' . $likeExpr->getStringPattern();
|
2009-01-20 20:07:07 +03:00
|
|
|
return $sql;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function walkComparisonExpression($compExpr)
|
|
|
|
{
|
|
|
|
$sql = '';
|
2009-01-22 22:38:10 +03:00
|
|
|
if ($compExpr->getLeftExpression() instanceof AST\ArithmeticExpression) {
|
2009-01-20 20:07:07 +03:00
|
|
|
$sql .= $this->walkArithmeticExpression($compExpr->getLeftExpression());
|
|
|
|
} // else...
|
|
|
|
$sql .= ' ' . $compExpr->getOperator() . ' ';
|
2009-01-22 22:38:10 +03:00
|
|
|
if ($compExpr->getRightExpression() instanceof AST\ArithmeticExpression) {
|
2009-01-20 20:07:07 +03:00
|
|
|
$sql .= $this->walkArithmeticExpression($compExpr->getRightExpression());
|
|
|
|
}
|
|
|
|
return $sql;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function walkArithmeticExpression($arithmeticExpr)
|
|
|
|
{
|
|
|
|
$sql = '';
|
|
|
|
if ($arithmeticExpr->isSimpleArithmeticExpression()) {
|
|
|
|
foreach ($arithmeticExpr->getSimpleArithmeticExpression()->getArithmeticTerms() as $term) {
|
|
|
|
$sql .= $this->walkArithmeticTerm($term);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$sql .= $this->walkSubselect($arithmeticExpr->getSubselect());
|
|
|
|
}
|
|
|
|
return $sql;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function walkArithmeticTerm($term)
|
|
|
|
{
|
2009-01-21 21:25:05 +03:00
|
|
|
if (is_string($term)) return $term;
|
|
|
|
return implode(' ', array_map(array(&$this, 'walkArithmeticFactor'),
|
|
|
|
$term->getArithmeticFactors()));
|
2009-01-20 20:07:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public function walkArithmeticFactor($factor)
|
|
|
|
{
|
2009-01-21 21:25:05 +03:00
|
|
|
if (is_string($factor)) return $factor;
|
2009-01-20 20:07:07 +03:00
|
|
|
$sql = '';
|
|
|
|
$primary = $factor->getArithmeticPrimary();
|
2009-01-21 21:25:05 +03:00
|
|
|
if (is_numeric($primary)) {
|
|
|
|
$sql .= $primary;
|
2009-01-22 22:38:10 +03:00
|
|
|
} else if (is_string($primary)) {
|
|
|
|
//TODO: quote string according to platform
|
|
|
|
$sql .= $primary;
|
|
|
|
} else if ($primary instanceof AST\PathExpression) {
|
2009-01-20 20:07:07 +03:00
|
|
|
$sql .= $this->walkPathExpression($primary);
|
2009-01-22 22:38:10 +03:00
|
|
|
} else if ($primary instanceof AST\InputParameter) {
|
2009-01-20 20:07:07 +03:00
|
|
|
if ($primary->isNamed()) {
|
|
|
|
$sql .= ':' . $primary->getName();
|
|
|
|
} else {
|
|
|
|
$sql .= '?';
|
|
|
|
}
|
2009-01-22 22:38:10 +03:00
|
|
|
} else if ($primary instanceof AST\SimpleArithmeticExpression) {
|
2009-01-21 21:25:05 +03:00
|
|
|
$sql .= '(' . $this->walkSimpleArithmeticExpression($primary) . ')';
|
2009-01-20 20:07:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// else...
|
|
|
|
|
|
|
|
return $sql;
|
|
|
|
}
|
|
|
|
|
2009-01-21 21:25:05 +03:00
|
|
|
public function walkSimpleArithmeticExpression($simpleArithmeticExpr)
|
|
|
|
{
|
|
|
|
return implode(' ', array_map(array(&$this, 'walkArithmeticTerm'),
|
|
|
|
$simpleArithmeticExpr->getArithmeticTerms()));
|
|
|
|
}
|
|
|
|
|
2009-01-20 20:07:07 +03:00
|
|
|
public function walkPathExpression($pathExpr)
|
|
|
|
{
|
|
|
|
$sql = '';
|
|
|
|
if ($pathExpr->isSimpleStateFieldPathExpression()) {
|
|
|
|
$parts = $pathExpr->getParts();
|
|
|
|
$numParts = count($parts);
|
|
|
|
$dqlAlias = $parts[0];
|
|
|
|
$fieldName = $parts[$numParts-1];
|
|
|
|
$qComp = $this->_parserResult->getQueryComponent($dqlAlias);
|
|
|
|
$class = $qComp['metadata'];
|
|
|
|
|
|
|
|
if ($numParts > 2) {
|
|
|
|
for ($i = 1; $i < $numParts-1; ++$i) {
|
|
|
|
//TODO
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$sqlTableAlias = $this->_dqlToSqlAliasMap[$dqlAlias];
|
|
|
|
$sql .= $sqlTableAlias . '.' . $class->getColumnName($fieldName);
|
|
|
|
} else if ($pathExpr->isSimpleStateFieldAssociationPathExpression()) {
|
|
|
|
throw new Doctrine_Exception("Not yet implemented.");
|
|
|
|
} else {
|
|
|
|
throw new Doctrine_ORM_Query_Exception("Encountered invalid PathExpression during SQL construction.");
|
|
|
|
}
|
|
|
|
return $sql;
|
|
|
|
}
|
|
|
|
|
2009-01-19 21:40:12 +03:00
|
|
|
/**
|
|
|
|
* Generates an SQL table alias from given table name and associates
|
|
|
|
* it with given component alias
|
|
|
|
*
|
|
|
|
* @param string $componentName Component name to be associated with generated table alias
|
|
|
|
* @return string Generated table alias
|
|
|
|
*/
|
|
|
|
public function generateTableAlias($componentName)
|
|
|
|
{
|
|
|
|
$baseAlias = strtolower(preg_replace('/[^A-Z]/', '\\1', $componentName));
|
|
|
|
|
|
|
|
// We may have a situation where we have all chars are lowercased
|
|
|
|
if ($baseAlias == '') {
|
|
|
|
// We simply grab the first 2 chars of component name
|
2009-01-22 22:38:10 +03:00
|
|
|
$baseAlias = substr($componentName, 0, 2);
|
2009-01-19 21:40:12 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
$alias = $baseAlias;
|
|
|
|
|
|
|
|
if ( ! isset($this->_tableAliasSeeds[$baseAlias])) {
|
|
|
|
$this->_tableAliasSeeds[$baseAlias] = 1;
|
|
|
|
} else {
|
|
|
|
$alias .= $this->_tableAliasSeeds[$baseAlias]++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $alias;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|