Job implements IJob
Base class for background jobs
This is here if you want to do advanced stuff in your background jobs. For the most common use cases have a look at QueuedJob and TimedJob
Tags
Interfaces, Classes and Traits
- IJob
- Interface IJob
Table of Contents
- $argument : mixed
- $id : int
- $lastRun : int
- $time : ITimeFactory
- __construct() : mixed
- execute() : mixed
- The function to prepare the execution of the job.
- getArgument() : mixed
- Get the argument associated with the background job This is the argument that will be passed to the background job
- getId() : int
- Get the id of the background job This id is determined by the job list when a job is added to the list
- getLastRun() : int
- Get the last time this job was run as unix timestamp
- setArgument() : mixed
- setId() : mixed
- setLastRun() : mixed
- run() : mixed
- The actual function that is called to run the job
Properties
$argument
protected
mixed
$argument
$id
protected
int
$id
$lastRun
protected
int
$lastRun
$time
protected
ITimeFactory
$time
Methods
__construct()
public
__construct(ITimeFactory $time) : mixed
Parameters
- $time : ITimeFactory
Tags
Return values
mixed —execute()
The function to prepare the execution of the job.
public
execute(IJobList $jobList[, ILogger|null $logger = null ]) : mixed
Parameters
Tags
Return values
mixed —getArgument()
Get the argument associated with the background job This is the argument that will be passed to the background job
public
getArgument() : mixed
Tags
Return values
mixed —getId()
Get the id of the background job This id is determined by the job list when a job is added to the list
public
final getId() : int
Tags
Return values
int —getLastRun()
Get the last time this job was run as unix timestamp
public
final getLastRun() : int
Tags
Return values
int —setArgument()
public
setArgument(mixed $argument) : mixed
Parameters
- $argument : mixed
Tags
Return values
mixed —setId()
public
final setId(mixed $id) : mixed
Parameters
- $id : mixed
Tags
Return values
mixed —setLastRun()
public
final setLastRun(mixed $lastRun) : mixed
Parameters
- $lastRun : mixed
Tags
Return values
mixed —run()
The actual function that is called to run the job
protected
abstract run( $argument) : mixed