This commit is contained in:
parent
82da462265
commit
e03ef62527
@ -48,6 +48,8 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
|
|||||||
*/
|
*/
|
||||||
protected $isSubquery;
|
protected $isSubquery;
|
||||||
|
|
||||||
|
protected $isLimitSubqueryUsed = false;
|
||||||
|
|
||||||
protected $neededTables = array();
|
protected $neededTables = array();
|
||||||
/**
|
/**
|
||||||
* @var array $pendingFields
|
* @var array $pendingFields
|
||||||
@ -128,6 +130,15 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
|
|||||||
{
|
{
|
||||||
return $this->_enumParams;
|
return $this->_enumParams;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* limitSubqueryUsed
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function isLimitSubqueryUsed()
|
||||||
|
{
|
||||||
|
return $this->isLimitSubqueryUsed;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* convertEnums
|
* convertEnums
|
||||||
* convert enum parameters to their integer equivalents
|
* convert enum parameters to their integer equivalents
|
||||||
@ -564,6 +575,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
|
|||||||
$rootAlias = key($this->_aliasMap);
|
$rootAlias = key($this->_aliasMap);
|
||||||
|
|
||||||
if ( ! empty($this->parts['limit']) && $this->needsSubquery && $table->getAttribute(Doctrine::ATTR_QUERY_LIMIT) == Doctrine::LIMIT_RECORDS) {
|
if ( ! empty($this->parts['limit']) && $this->needsSubquery && $table->getAttribute(Doctrine::ATTR_QUERY_LIMIT) == Doctrine::LIMIT_RECORDS) {
|
||||||
|
$this->isLimitSubqueryUsed = true;
|
||||||
$needsSubQuery = true;
|
$needsSubQuery = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -702,7 +714,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->aliasHandler->hasAliasFor($part)) {
|
if($this->aliasHandler->hasAlias($part)) {
|
||||||
$parts[$k] = $this->aliasHandler->generateNewAlias($part);
|
$parts[$k] = $this->aliasHandler->generateNewAlias($part);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -896,6 +908,11 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
|
|||||||
$componentAlias = $prevPath;
|
$componentAlias = $prevPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if the current alias already exists, skip it
|
||||||
|
if (isset($this->_aliasMap[$componentAlias])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ( ! isset($table)) {
|
if ( ! isset($table)) {
|
||||||
// process the root of the path
|
// process the root of the path
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user