Commit d4ad6ead authored by Hugh Davenport's avatar Hugh Davenport
Browse files

Add more search constraint types



Now allows for null, and more comparison operators

Change-Id: I4ab9cb8161a346a7a4d5e79f96421cf360b71e4c
Signed-off-by: default avatarHugh Davenport <hugh@catalyst.net.nz>
parent a1427023
......@@ -339,8 +339,29 @@ class PluginSearchInternal extends PluginSearch {
$values[] = $string;
return ' ' . $ilike . ' ? || \'%\'';
case 'equals':
if ($string === null) {
return ' IS NULL ';
}
$values[] = $string;
return ' = ? ';
case 'notequals':
if (is_null($string)) {
return ' IS NOT NULL ';
}
$values[] = $string;
return ' <> ? ';
case 'greaterthan':
$values[] = $string;
return ' > ? ';
case 'greaterthanequal':
$values[] = $string;
return ' >= ? ';
case 'lessthan':
$values[] = $string;
return ' < ? ';
case 'lessthanequal':
$values[] = $string;
return ' <= ? ';
case 'contains':
$values[] = $string;
return ' ' . $ilike . ' \'%\' || ? || \'%\'';
......
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