Permalink
Browse files

Extended complexWhere to allow a negative operator

  • Loading branch information...
Chris Hoult
Chris Hoult committed Sep 15, 2011
1 parent fb43267 commit 3aeceaf21bfdeb561a816c0a32f39c1842f13852
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/Helios/HQL.php
View
@@ -936,7 +936,15 @@ private function _complexWhere( $fieldName, array $terms, $and )
}
else
{
- $where .= "$fieldName = ?";
+ if ( preg_match( '/^!(.+)$/', $term, $matches ) )
+ {
+ $term = $matches[ 1 ];
+ $where .= "$fieldName != ?";
+ }
+ else
+ {
+ $where .= "$fieldName = ?";
+ }
$params[] = $term;
}
}

0 comments on commit 3aeceaf

Please sign in to comment.