diff --git a/include/class.orm.php b/include/class.orm.php index 264582fb6885c4dd636aaa09f9777f5c421e652d..d638a7dc9c2fd02a28e6778d9c246a2e0c81db10 100644 --- a/include/class.orm.php +++ b/include/class.orm.php @@ -808,7 +808,7 @@ class MySqlCompiler extends SqlCompiler { 'lt' => '%1$s < %2$s', 'gte' => '%1$s >= %2$s', 'lte' => '%1$s <= %2$s', - 'isnull' => '%1$s IS NULL', + 'isnull' => array('self', '__isnull'), 'like' => '%1$s LIKE %2$s', 'hasbit' => '%1$s & %2$s != 0', 'in' => array('self', '__in'), @@ -830,6 +830,12 @@ class MySqlCompiler extends SqlCompiler { return sprintf('%s IN (%s)', $a, $b); } + function __isnull($a, $b) { + return $b + ? sprintf('%s IS NULL', $a) + : sprintf('%s IS NOT NULL', $a); + } + function compileJoin($tip, $model, $alias, $info) { $constraints = array(); $join = ' JOIN ';