diff --git a/library/Director/PropertyModifier/PropertyModifierRejectOrSelect.php b/library/Director/PropertyModifier/PropertyModifierRejectOrSelect.php index c2d6bee4..51d93e5c 100644 --- a/library/Director/PropertyModifier/PropertyModifierRejectOrSelect.php +++ b/library/Director/PropertyModifier/PropertyModifierRejectOrSelect.php @@ -26,7 +26,9 @@ class PropertyModifierRejectOrSelect extends PropertyModifierHook 'multiOptions' => $form->optionalEnum([ 'wildcard' => $form->translate('Simple match with wildcards (*)'), 'regex' => $form->translate('Regular Expression'), + 'is_null' => $form->translate('Match NULL value columns'), ]), + 'class' => 'autosubmit', ]); $form->addElement('text', 'filter_string', [ @@ -59,6 +61,11 @@ class PropertyModifierRejectOrSelect extends PropertyModifierHook return preg_match($expression, $string); } + public function isNull($string, $expression) + { + return $string === null; + } + public function matchesWildcard($string, $expression) { return $this->filterExpression->matches( @@ -80,6 +87,9 @@ class PropertyModifierRejectOrSelect extends PropertyModifierHook case 'regex': $func = 'matchesRegexp'; break; + case 'is_null': + $func = 'isNull'; + break; default: throw new ConfigurationError( '%s is not a valid value for an ArrayFilter filter_method',