1
0
mirror of synced 2025-02-20 14:13:15 +03:00
This commit is contained in:
zYne 2007-08-14 20:44:48 +00:00
parent 2e9490fb5c
commit f6c1560ebc

View File

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