Commit e03ef625 authored by zYne's avatar zYne

--no commit message

--no commit message
parent 82da4622
......@@ -48,6 +48,8 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
*/
protected $isSubquery;
protected $isLimitSubqueryUsed = false;
protected $neededTables = array();
/**
* @var array $pendingFields
......@@ -128,6 +130,15 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
{
return $this->_enumParams;
}
/**
* limitSubqueryUsed
*
* @return boolean
*/
public function isLimitSubqueryUsed()
{
return $this->isLimitSubqueryUsed;
}
/**
* convertEnums
* convert enum parameters to their integer equivalents
......@@ -564,6 +575,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
$rootAlias = key($this->_aliasMap);
if ( ! empty($this->parts['limit']) && $this->needsSubquery && $table->getAttribute(Doctrine::ATTR_QUERY_LIMIT) == Doctrine::LIMIT_RECORDS) {
$this->isLimitSubqueryUsed = true;
$needsSubQuery = true;
}
......@@ -702,7 +714,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
continue;
}
if($this->aliasHandler->hasAliasFor($part)) {
if($this->aliasHandler->hasAlias($part)) {
$parts[$k] = $this->aliasHandler->generateNewAlias($part);
}
......@@ -896,6 +908,11 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
$componentAlias = $prevPath;
}
// if the current alias already exists, skip it
if (isset($this->_aliasMap[$componentAlias])) {
continue;
}
if ( ! isset($table)) {
// process the root of the path
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment