public function buildNotCondition($operator, $operands)
    {
        if (count($operands) !== 2) {
            throw new InvalidParamException("Operator '$operator' requires two operands.");
        }

        list($name, $value) = $operands;

        $result = [];
        if (is_array($value)) {
            $result[$name] = ['$not' => $this->buildCondition($value)];
        } else {
            if ($name == '_id') {
                $value = $this->ensureMongoId($value);
            }
            $result[$name] = ['$ne' => $value];
        }

        return $result;
    }
public function buildNotCondition($operator, $operands)
    {
        if (count($operands) !== 2) {
            throw new InvalidParamException("Operator '$operator' requires two operands.");
        }

        list($name, $value) = $operands;

        $result = [];
        if (is_array($value)) {
            $result[$name] = ['$not' => $this->buildCondition($value)];
        } else {
            if ($name == '_id') {
                $value = $this->ensureMongoId($value);
            }
            $result[$name] = ['$ne' => $value];
        }

        return $result;
    }
public function buildNotCondition ( $ operator , $ operands ) { if ( count ( $ operands ) !== 2 ) { throw new InvalidParamException ( "Operator '$operator' requires two operands." ) ; } list ( $ name , $ value ) = $ operands ; $ result = [ ] ; if ( is_array ( $ value ) ) { $ result [ $ name ] = [ '$not' => $ this -> buildCondition ( $ value ) ] ; } else { if ( $ name == '_id' ) { $ value = $ this -> ensureMongoId ( $ value ) ; } $ result [ $ name ] = [ '$ne' => $ value ] ; } return $ result ; }
Composes `NOT` condition.
@param string $operator the operator to use for connecting the given operands
@param array $operands the Mongo conditions to connect.
@return array the generated Mongo condition.
@throws InvalidParamException if wrong number of operands have been given.
Composes NOT condition .