A PHP representation of the DSE DateRange datatype

Extends

Methods

__construct

( mixed $bounds )

Create a Dse\DateRange object

<?php
use Dse\DateRange;
use Dse\DateRange\Bound;
use Dse\DateRange\Precision;

// DateRange constructed with a single Bound object.
$bound = new Bound(Precision::YEAR, 1491252166000);
$dr = new DateRange($bound);

// A DateRange with lower and upper bounds, using a mix of Bound object and raw values
$dr = new DateRange($bound, Precision::DAY, 1491252266000);

// Range with no lower bound
$dr = new DateRange(Bound::unbounded(), $bound);
Parameters:
Name Type Details
$bounds mixed

A variadic list of args that denote a single-date bound or a lower and upper bound pair

Type\Custom

type

( )

The type of this value.

Returns:
Type Details
Type\Custom

the custom type for Dse\DateRange

Bound

lowerBound

( )
Returns:
Type Details
DateRange\Bound

the lower-bound or single-date-bound of this Dse\DateRange

Bound

upperBound

( )
Returns:
Type Details
DateRange\Bound

the upper-bound of this Dse\DateRange; null if this is a single-date Dse\DateRange

boolean

isSingleDate

( )
Returns:
Type Details
boolean

whether or not this Dse\DateRange has a single date value

string

__toString

( )
Returns:
Type Details
string

string representation of this Dse\DateRange