Commit f6c1560e authored by zYne's avatar zYne

--no commit message

--no commit message
parent 2e9490fb
...@@ -79,13 +79,9 @@ abstract class Doctrine_Query_Abstract extends Doctrine_Hydrate ...@@ -79,13 +79,9 @@ abstract class Doctrine_Query_Abstract extends Doctrine_Hydrate
* @param mixed $params an array of parameters or a simple scalar * @param mixed $params an array of parameters or a simple scalar
* @return Doctrine_Query * @return Doctrine_Query
*/ */
public function whereIn($params = array()) public function whereIn($expr, $params = array())
{ {
if (is_array($params)) { $params = (array) $params;
$this->_params = array_merge($this->_params, $params);
} else {
$this->_params[] = $params;
}
$a = array(); $a = array();
foreach ($params as $k => $value) { foreach ($params as $k => $value) {
if ($value instanceof Doctrine_Expression) { if ($value instanceof Doctrine_Expression) {
...@@ -96,6 +92,9 @@ abstract class Doctrine_Query_Abstract extends Doctrine_Hydrate ...@@ -96,6 +92,9 @@ abstract class Doctrine_Query_Abstract extends Doctrine_Hydrate
} }
$a[] = $value; $a[] = $value;
} }
$this->_params = array_merge($this->_params, $params);
$where = $expr . ' IN (' . implode(', ', $a) . ')'; $where = $expr . ' IN (' . implode(', ', $a) . ')';
return $this->parseQueryPart('where', $where, true); return $this->parseQueryPart('where', $where, true);
......
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