From 071d5425bc5d3b1cb4a16543800f271bd6ec0173 Mon Sep 17 00:00:00 2001 From: zYne Date: Sat, 10 Nov 2007 15:46:01 +0000 Subject: [PATCH] fixes #580 --- lib/Doctrine/Query/Abstract.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/Query/Abstract.php b/lib/Doctrine/Query/Abstract.php index 09e0d4e83..8a65dbe4b 100644 --- a/lib/Doctrine/Query/Abstract.php +++ b/lib/Doctrine/Query/Abstract.php @@ -78,11 +78,12 @@ abstract class Doctrine_Query_Abstract extends Doctrine_Hydrate * whereIn * 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 boolean $not whether or not to use NOT in front of IN * @return Doctrine_Query */ - public function whereIn($expr, $params = array()) + public function whereIn($expr, $params = array(), $not = false) { $params = (array) $params; $a = array(); @@ -98,7 +99,7 @@ abstract class Doctrine_Query_Abstract extends Doctrine_Hydrate $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); } @@ -374,4 +375,4 @@ abstract class Doctrine_Query_Abstract extends Doctrine_Hydrate * @return Doctrine_Query this object */ abstract public function parseQueryPart($queryPartName, $queryPart, $append = false); -} \ No newline at end of file +}