File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -93,13 +93,17 @@ public function get_comparison() {
93
93
*/
94
94
public function __toString () {
95
95
$ db = Database::get ();
96
- if ($ this ->comparison == 'IN ' ) {
96
+ if ($ this ->comparison == 'IN ' || $ this ->comparison == 'NOT IN ' ) {
97
+ $ not = '' ;
98
+ if ($ this ->comparison == 'NOT IN ' ) {
99
+ $ not = 'NOT ' ;
100
+ }
97
101
if (!is_array ($ this ->value )) {
98
- throw new \Exception ('Error in condition: the IN value specified for ' . $ this ->local_field . ' must be an array ' );
102
+ throw new \Exception ('Error in condition: the ' . $ not . ' IN value specified for ' . $ this ->local_field . ' must be an array ' );
99
103
}
100
104
101
105
if (empty ($ this ->value ) === true ) {
102
- return $ db ->quote_identifier ($ this ->local_field ) . ' IN (NULL) ' ;
106
+ return $ db ->quote_identifier ($ this ->local_field ) . ' ' . $ not . ' IN (NULL) ' ;
103
107
}
104
108
105
109
/**
@@ -120,10 +124,10 @@ public function __toString() {
120
124
$ condition = '( ' ;
121
125
if (count ($ non_null ) > 0 ) {
122
126
$ list = implode (', ' , $ db ->quote ($ non_null ));
123
- $ condition .= $ db ->quote_identifier ($ this ->local_field ) . ' IN ( ' . $ list . ') ' ;
127
+ $ condition .= $ db ->quote_identifier ($ this ->local_field ) . ' ' . $ not . ' IN ( ' . $ list . ') ' ;
124
128
}
125
129
if (count ($ null ) > 0 ) {
126
- $ condition .= ' OR ' . $ db ->quote_identifier ($ this ->local_field ) . ' IS NULL ) ' ;
130
+ $ condition .= ' OR ' . $ db ->quote_identifier ($ this ->local_field ) . ' IS ' . $ not . ' NULL ) ' ;
127
131
}
128
132
$ condition .= ') ' ;
129
133
You can’t perform that action at this time.
0 commit comments