phpBB API Documentation
Interface

phpbb\cron\task\parametrized

interface parametrized implements task

Parametrized cron task interface.

Parametrized cron tasks are somewhat of a cross between regular cron tasks and delayed jobs. Whereas regular cron tasks perform some action globally, parametrized cron tasks perform actions on a particular object (or objects). Parametrized cron tasks do not make sense and are not usable without specifying these objects.

Methods

string get_name()

Returns the name of the task.

from task
null run()

Runs this cron task.

from task
bool is_runnable()

Returns whether this cron task can run, given current board configuration.

from task
bool should_run()

Returns whether this cron task should run now, because enough time has passed since it was last run.

from task
array get_parameters()

Returns parameters of this cron task as an array.

null parse_parameters(request_interface $request)

Parses parameters found in $request, which is an instance of \phpbb\request\request_interface.

Details

in task at line 26
public string get_name()

Returns the name of the task.

Return Value

string Name of wrapped task.

in task at line 33
public null run()

Runs this cron task.

Return Value

null

in task at line 43
public bool is_runnable()

Returns whether this cron task can run, given current board configuration.

For example, a cron task that prunes forums can only run when forum pruning is enabled.

Return Value

bool

in task at line 51
public bool should_run()

Returns whether this cron task should run now, because enough time has passed since it was last run.

Return Value

bool

at line 34
public array get_parameters()

Returns parameters of this cron task as an array.

The array must map string keys to string values.

Return Value

array

at line 47
public null parse_parameters(request_interface $request)

Parses parameters found in $request, which is an instance of \phpbb\request\request_interface.

$request contains user input and must not be trusted. Cron task must validate all data before using it.

Parameters

request_interface $request Request object.

Return Value

null