CMS Made Simple API

CmsRegularTask
in

An interface to define how tasks should work.

Tags
license

GPL

since
1.8

Table of Contents

Methods

execute()  : bool
Execute a given task
get_description()  : string
Get the description for this task.
get_name()  : string
Get the name for this task
on_failure()  : mixed
Execute steps that should be taken on failure of this task.
on_success()  : mixed
Execute steps that should be taken on success of this task.
test()  : mixed
Test if a function should be executed given the supplied time argument

Methods

execute()

Execute a given task

public execute([int $time = '' ]) : bool
Parameters
$time : int = ''

The time at which the task should consider the execution occurred at. Assume the current time if empty.

Return values
bool

TRUE on success, FALSE otherwise.

get_description()

Get the description for this task.

public get_description() : string
Return values
string

on_failure()

Execute steps that should be taken on failure of this task.

public on_failure([int $time = '' ]) : mixed

This method is called after the execute step if the execute step returned FALSE.

Parameters
$time : int = ''

The time at which the task should consider the execution occurred at. Assume the current time if empty.

on_success()

Execute steps that should be taken on success of this task.

public on_success([int $time = '' ]) : mixed

This method is called after the execute step if the execute step returned TRUE.

Parameters
$time : int = ''

The time at which the task should consider the execution occurred at. Assume the current time if empty.

test()

Test if a function should be executed given the supplied time argument

public test([int $time = '' ]) : mixed
Parameters
$time : int = ''

The time at which any comparisons for execution should be performed. If empty the current time is assumed.

Tags
returns

boolean TRUE IF the task should be executed, FALSE otherwise.


        
On this page

Search results