final class Timer_Manager

A static class to manage the saving and loading of Timers from the database.

Constants

TIMERS_OPTION

Methods

static Timer[]
get_timers()

Return all Timers instances from the database in an associative list of their IDs.

static 
run_timer_queue()

Check all Timers to maybe be run.

static null|Timer
get_timer(string $timer_id)

Find a Timer instance and return it, or NULL if not found.

static bool
update_timer(Timer $Timer, bool $merge_actions = false)

Update/add a Timer, optionally merge Actions with a previously existing Timer being overwritten.

static bool
set_timers(array $Timers)

Given an array of Timers, update all Timers in the database to reflect the data in the array.

static bool
delete_timer(string $timer_id)

Attempt to delete a timer from the database.

Details

at line 35
final static Timer[] get_timers()

Return all Timers instances from the database in an associative list of their IDs.

Return Value

Timer[]

The Timers.

at line 49
final static run_timer_queue()

Check all Timers to maybe be run.

at line 64
final static null|Timer get_timer(string $timer_id)

Find a Timer instance and return it, or NULL if not found.

Parameters

string $timer_id

The Timer ID.

Return Value

null|Timer

The Timer instance or NULL.

at line 82
final static bool update_timer(Timer $Timer, bool $merge_actions = false)

Update/add a Timer, optionally merge Actions with a previously existing Timer being overwritten.

Parameters

Timer $Timer

The Timer instance to update.

bool $merge_actions

Whether or not to merge action with a previously existing Timer. (default FALSE)

Return Value

bool

Whether or not the Timers were persisted to the database.

at line 101
final static bool set_timers(array $Timers)

Given an array of Timers, update all Timers in the database to reflect the data in the array.

Parameters

array $Timers

Return Value

bool

Whether or not the option was persisted to the database.

at line 123
final static bool delete_timer(string $timer_id)

Attempt to delete a timer from the database.

Parameters

string $timer_id

The ID of the Timer to remove.

Return Value

bool

Whether or not the Timer was successfully removed.