Commit 071d5425 authored by zYne's avatar zYne

fixes #580

parent 6b03c4c2
...@@ -78,11 +78,12 @@ abstract class Doctrine_Query_Abstract extends Doctrine_Hydrate ...@@ -78,11 +78,12 @@ abstract class Doctrine_Query_Abstract extends Doctrine_Hydrate
* whereIn * whereIn
* adds IN condition to the query WHERE part * adds IN condition to the query WHERE part
* *
* @param string $expr * @param string $expr the operand of the IN
* @param mixed $params an array of parameters or a simple scalar * @param mixed $params an array of parameters or a simple scalar
* @param boolean $not whether or not to use NOT in front of IN
* @return Doctrine_Query * @return Doctrine_Query
*/ */
public function whereIn($expr, $params = array()) public function whereIn($expr, $params = array(), $not = false)
{ {
$params = (array) $params; $params = (array) $params;
$a = array(); $a = array();
...@@ -98,7 +99,7 @@ abstract class Doctrine_Query_Abstract extends Doctrine_Hydrate ...@@ -98,7 +99,7 @@ abstract class Doctrine_Query_Abstract extends Doctrine_Hydrate
$this->_params['where'] = array_merge($this->_params['where'], $params); $this->_params['where'] = array_merge($this->_params['where'], $params);
$where = $expr . ' IN (' . implode(', ', $a) . ')'; $where = $expr . ($not === true ? ' NOT ':'') . ' IN (' . implode(', ', $a) . ')';
return $this->parseQueryPart('where', $where, true); return $this->parseQueryPart('where', $where, true);
} }
...@@ -374,4 +375,4 @@ abstract class Doctrine_Query_Abstract extends Doctrine_Hydrate ...@@ -374,4 +375,4 @@ abstract class Doctrine_Query_Abstract extends Doctrine_Hydrate
* @return Doctrine_Query this object * @return Doctrine_Query this object
*/ */
abstract public function parseQueryPart($queryPartName, $queryPart, $append = false); abstract public function parseQueryPart($queryPartName, $queryPart, $append = false);
} }
\ No newline at end of file
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