TimeInterval
in package
Class TimeInterval
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- TimeInterval constructor.
- withCustomInterval() : TimeInterval
- Returns TimeInterval with provided custom interval.
- withTextInterval() : TimeInterval
- Creates a new instance of TimeInterval with provided time boundaries.
Properties
$custom
public
string
$custom
Tags
$from
public
DateTime
$from
Tags
$to
public
DateTime
$to
Tags
Methods
__construct()
TimeInterval constructor.
public
__construct([DateTime|null $from = null ][, DateTime|null $to = null ]) : mixed
Parameters
- $from : DateTime|null = null
- $to : DateTime|null = null
withCustomInterval()
Returns TimeInterval with provided custom interval.
public
static withCustomInterval(string $customInterval) : TimeInterval
Parameters
- $customInterval : string
Return values
TimeIntervalwithTextInterval()
Creates a new instance of TimeInterval with provided time boundaries.
public
static withTextInterval(string $from, string $to) : TimeInterval
Time must be in "H:i" format. If time cannot be parsed, then RuntimeException will be thrown.
Parameters
- $from : string
- $to : string