Commit 26ee84d5 authored by mahono's avatar mahono

fixed bug in Doctrine_Query::copy() - params were not copied

parent e9ba4504
...@@ -1448,7 +1448,6 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable ...@@ -1448,7 +1448,6 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
. $table->getColumnName($table->getIdentifier()) . $table->getColumnName($table->getIdentifier())
. ' = ' . ' = '
. $assocAlias . '.' . $relation->getForeign(); . $assocAlias . '.' . $relation->getForeign();
} }
$this->parts['from'][] = $queryPart; $this->parts['from'][] = $queryPart;
...@@ -1641,6 +1640,13 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable ...@@ -1641,6 +1640,13 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
return $this->execute($params, $hydrationMode); return $this->execute($params, $hydrationMode);
} }
/**
* Copies a Doctrine_Query object.
*
* @param Doctrine_Query Doctrine query instance.
* If ommited the instance itself will be used as source.
* @return Doctrine_Query Copy of the Doctrine_Query instance.
*/
public function copy(Doctrine_Query $query = null) public function copy(Doctrine_Query $query = null)
{ {
if ( ! $query) { if ( ! $query) {
...@@ -1649,6 +1655,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable ...@@ -1649,6 +1655,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
$new = new Doctrine_Query(); $new = new Doctrine_Query();
$new->_dqlParts = $query->_dqlParts; $new->_dqlParts = $query->_dqlParts;
$new->_params = $query->_params;
$new->_hydrationMode = $query->_hydrationMode; $new->_hydrationMode = $query->_hydrationMode;
return $new; return $new;
......
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