From 09243b24166cdc732d47b3348ccd9309416f37e4 Mon Sep 17 00:00:00 2001 From: guilhermeblanco Date: Fri, 15 Feb 2008 15:07:47 +0000 Subject: [PATCH] Added NOT operator recognition in DQL (fixes #496) --- lib/Doctrine/Query/Condition.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/Query/Condition.php b/lib/Doctrine/Query/Condition.php index 69cd28623..835f8fcf0 100644 --- a/lib/Doctrine/Query/Condition.php +++ b/lib/Doctrine/Query/Condition.php @@ -63,10 +63,16 @@ abstract class Doctrine_Query_Condition extends Doctrine_Query_Part } $r = implode(' OR ', $ret); } else { + // Fix for #710 if (substr($parts[0],0,1) == '(' && substr($parts[0], -1) == ')') { return $this->parse(substr($parts[0], 1, -1)); } else { - return $this->load($parts[0]); + // Processing NOT here + if (strtoupper(substr($parts[0], 0, 4)) === 'NOT ') { + $r = 'NOT ('.$this->parse(substr($parts[0], 4)).')'; + } else { + return $this->load($parts[0]); + } } } }