public function buildBetweenCondition($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 [
                $column => [
                    '$lt' => $value1,
                    '$gt' => $value2,
                ]
            ];
        }
        return [
            $column => [
                '$gte' => $value1,
                '$lte' => $value2,
            ]
        ];
    }
public function buildBetweenCondition($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 [
                $column => [
                    '$lt' => $value1,
                    '$gt' => $value2,
                ]
            ];
        }
        return [
            $column => [
                '$gte' => $value1,
                '$lte' => $value2,
            ]
        ];
    }
public function buildBetweenCondition ( $ 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 [ $ column => [ '$lt' => $ value1 , '$gt' => $ value2 , ] ] ; } return [ $ column => [ '$gte' => $ value1 , '$lte' => $ value2 , ] ] ; }
Creates an Mongo condition, which emulates the `BETWEEN` operator.
@param string $operator the operator to use
@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 the generated Mongo condition.
@throws InvalidParamException if wrong number of operands have been given.
Creates an Mongo condition which emulates the BETWEEN operator .