protected function filterBetweenCondition(array $data, $operator, $operands)
    {
        if (!isset($operands[0], $operands[1], $operands[2])) {
            throw new InvalidParamException("Operator '$operator' requires three operands.");
        }

        list($column, $value1, $value2) = $operands;

        if (strncmp('NOT', $operator, 3) === 0) {
            return array_filter($data, function ($row) use ($column, $value1, $value2) {
                return $row[$column] < $value1 || $row[$column] > $value2;
            });
        }

        return array_filter($data, function ($row) use ($column, $value1, $value2) {
            return $row[$column] >= $value1 && $row[$column] <= $value2;
        });
    }
protected function filterBetweenCondition(array $data, $operator, $operands)
    {
        if (!isset($operands[0], $operands[1], $operands[2])) {
            throw new InvalidParamException("Operator '$operator' requires three operands.");
        }

        list($column, $value1, $value2) = $operands;

        if (strncmp('NOT', $operator, 3) === 0) {
            return array_filter($data, function ($row) use ($column, $value1, $value2) {
                return $row[$column] < $value1 || $row[$column] > $value2;
            });
        }

        return array_filter($data, function ($row) use ($column, $value1, $value2) {
            return $row[$column] >= $value1 && $row[$column] <= $value2;
        });
    }
protected function filterBetweenCondition ( array $ data , $ operator , $ operands ) { if ( ! isset ( $ operands [ 0 ] , $ operands [ 1 ] , $ operands [ 2 ] ) ) { throw new InvalidParamException ( "Operator '$operator' requires three operands." ) ; } list ( $ column , $ value1 , $ value2 ) = $ operands ; if ( strncmp ( 'NOT' , $ operator , 3 ) === 0 ) { return array_filter ( $ data , function ( $ row ) use ( $ column , $ value1 , $ value2 ) { return $ row [ $ column ] < $ value1 || $ row [ $ column ] > $ value2 ; } ) ; } return array_filter ( $ data , function ( $ row ) use ( $ column , $ value1 , $ value2 ) { return $ row [ $ column ] >= $ value1 && $ row [ $ column ] <= $ value2 ; } ) ; }
Applies `BETWEEN` condition.

@param array $data data to be filtered
@param string $operator operator
@param array $operands the first operand is the column name. The second and third operands
describe the interval that column value should be in

@return array filtered data

@throws InvalidParamException if wrong number of operands have been given
Applies BETWEEN condition .