collections icon indicating copy to clipboard operation
collections copied to clipboard

ExpressionBuilder doesn't have a 'is not null' expresion method

Open mikaelit opened this issue 8 years ago • 1 comments

ExpressionBuilder class has a method isNull() and it's based on equal operator. Why then we can't have a notNull() method based on miscellaneous operator? Is there any problem to compare result with '<>' operator? If not, my suggestion of method is allegorical for isNull(), and looks like this:

    /**
     * @param string $field
     *
     * @return Comparison
     */
    public function notNull($field)
    {
        return new Comparison($field, Comparison::NEQ, new Value(null));
    }

mikaelit avatar Sep 05 '17 13:09 mikaelit

Came here for exactly this reason. Mkaelit did you have time for a pullrequest?

michsk avatar Mar 09 '18 07:03 michsk