PHP Class business\TimeInterval

Author: Florian Voutzinos ([email protected])
Inheritance: implements JsonSerializable
Mostra file Open project: florianv/business Class Usage Examples

Public Methods

Method Description
__construct ( Time $start, Time $end ) Creates a time interval.
contains ( Time $time ) : boolean Checks if the interval contains the given time.
fromString ( string $startTime, string $endTime ) : TimeInterval Creates a new interval from time strings.
getEnd ( ) : Time Gets the end time.
getStart ( ) : Time Gets the start time.
jsonSerialize ( )

Method Details

__construct() public method

Creates a time interval.
public __construct ( Time $start, Time $end )
$start Time
$end Time

contains() public method

Checks if the interval contains the given time.
public contains ( Time $time ) : boolean
$time Time
return boolean

fromString() public static method

Creates a new interval from time strings.
public static fromString ( string $startTime, string $endTime ) : TimeInterval
$startTime string The start time
$endTime string The end time
return TimeInterval

getEnd() public method

Gets the end time.
public getEnd ( ) : Time
return Time

getStart() public method

Gets the start time.
public getStart ( ) : Time
return Time

jsonSerialize() public method

public jsonSerialize ( )