|
|
@@ -29,6 +29,10 @@ class SqlQueryWhereBuilder {
|
|
|
$this->_log[] = array('comparisonFieldToValue', $fieldName, $sqlCompSign, $value);
|
|
|
}
|
|
|
|
|
|
+ public function sql_filter_comparisonFieldIsNull($fieldName) {
|
|
|
+ $this->_log[] = array('comparisonFieldIsNull', $fieldName);
|
|
|
+ }
|
|
|
+
|
|
|
public function getQueryWhere($tablePrefix = '') {
|
|
|
$sqlWhereRaw = $this->parseQueryWhere();
|
|
|
$sqlTablePrefix = ($tablePrefix)? "`{$tablePrefix}`." : '';
|
|
|
@@ -102,6 +106,13 @@ class SqlQueryWhereBuilder {
|
|
|
array_push($sqlValuesStack, $stackValue);
|
|
|
//echo "L.".__LINE__.":sqlBlocksStack:" . json_encode($sqlBlocksStack) . "\n";
|
|
|
//echo "L.".__LINE__.":sqlValuesStack:" . json_encode($sqlValuesStack) . "\n\n";
|
|
|
+ } else if (is_array($log) && 2 == count($log) && 'comparisonFieldIsNull' == $log[0]) {
|
|
|
+ $sqlFieldName = $log[1];
|
|
|
+ $sqlFromStack = "{tablePrefix}`{$sqlFieldName}` is null";
|
|
|
+ $stackValue = array_pop($sqlValuesStack);
|
|
|
+ if (!is_array($stackValue)) throw new Exception("parse sql query failed - stack value is not array");
|
|
|
+ array_push($stackValue, $sqlFromStack);
|
|
|
+ array_push($sqlValuesStack, $stackValue);
|
|
|
} else {
|
|
|
throw new Exception("parse sql query failed - unknown '" . json_encode($log) . "'");
|
|
|
}
|