Class Symfony\Component\Stopwatch\Section

InheritanceSymfony\Component\Stopwatch\Section

Stopwatch section.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Constructor. Symfony\Component\Stopwatch\Section
get() Returns the child section. Symfony\Component\Stopwatch\Section
getEvent() Returns a specific event by name. Symfony\Component\Stopwatch\Section
getEvents() Returns the events from this section. Symfony\Component\Stopwatch\Section
getId() Symfony\Component\Stopwatch\Section
isEventStarted() Checks if the event was started. Symfony\Component\Stopwatch\Section
lap() Stops then restarts an event. Symfony\Component\Stopwatch\Section
open() Creates or re-opens a child section. Symfony\Component\Stopwatch\Section
setId() Sets the session identifier. Symfony\Component\Stopwatch\Section
startEvent() Starts an event. Symfony\Component\Stopwatch\Section
stopEvent() Stops an event. Symfony\Component\Stopwatch\Section

Method Details

__construct() public method

Constructor.

public void __construct ( $origin null )
$origin float|null

Set the origin of the events in this section, use null to set their origin to their start time

get() public method

Returns the child section.

public Symfony\Component\Stopwatch\Section|null get ( $id )
$id string

The child section identifier

return Symfony\Component\Stopwatch\Section|null

The child section or null when none found

getEvent() public method

Returns a specific event by name.

public Symfony\Component\Stopwatch\StopwatchEvent getEvent ( $name )
$name string

The event name

return Symfony\Component\Stopwatch\StopwatchEvent

The event

throws LogicException

When the event is not known

getEvents() public method

Returns the events from this section.

public Symfony\Component\Stopwatch\StopwatchEvent[] getEvents ( )
return Symfony\Component\Stopwatch\StopwatchEvent[]

An array of StopwatchEvent instances

getId() public method

public string getId ( )
return string

The identifier of the section

isEventStarted() public method

Checks if the event was started.

public bool isEventStarted ( $name )
$name string

The event name

lap() public method

Stops then restarts an event.

public Symfony\Component\Stopwatch\StopwatchEvent lap ( $name )
$name string

The event name

return Symfony\Component\Stopwatch\StopwatchEvent

The event

throws LogicException

When the event has not been started

open() public method

Creates or re-opens a child section.

public Symfony\Component\Stopwatch\Section open ( $id )
$id string|null

Null to create a new section, the identifier to re-open an existing one

return Symfony\Component\Stopwatch\Section

A child section

setId() public method

Sets the session identifier.

public Symfony\Component\Stopwatch\Section setId ( $id )
$id string

The session identifier

return Symfony\Component\Stopwatch\Section

The current section

startEvent() public method

Starts an event.

public Symfony\Component\Stopwatch\StopwatchEvent startEvent ( $name, $category )
$name string

The event name

$category string

The event category

return Symfony\Component\Stopwatch\StopwatchEvent

The event

stopEvent() public method

Stops an event.

public Symfony\Component\Stopwatch\StopwatchEvent stopEvent ( $name )
$name string

The event name

return Symfony\Component\Stopwatch\StopwatchEvent

The event

throws LogicException

When the event has not been started