PHP Class Clockwork\Request\Timeline

Show file Open project: itsgoingd/clockwork Class Usage Examples

Public Properties

Property Type Description
$data Timeline data

Public Methods

Method Description
addEvent ( $name, $description, $start_time, $end_time, array $data = [] ) Add a new event
endEvent ( $name ) End recording of event specified by name argument, throws exception if specified event is not found
finalize ( $start = null, $end = null ) End all unfinished events
startEvent ( $name, $description, $time = null, array $data = [] ) Start recording a new event, expects name, description and optional time as arguments, if time is not provided, current time will be used, if time equals 'start', request time will be used
toArray ( ) Return timeline data as array

Method Details

addEvent() public method

Add a new event
public addEvent ( $name, $description, $start_time, $end_time, array $data = [] )
$data array

endEvent() public method

End recording of event specified by name argument, throws exception if specified event is not found
public endEvent ( $name )

finalize() public method

End all unfinished events
public finalize ( $start = null, $end = null )

startEvent() public method

Start recording a new event, expects name, description and optional time as arguments, if time is not provided, current time will be used, if time equals 'start', request time will be used
public startEvent ( $name, $description, $time = null, array $data = [] )
$data array

toArray() public method

Return timeline data as array
public toArray ( )

Property Details

$data public property

Timeline data
public $data