Job

class OCP\BackgroundJob\Job
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
Source:lib/public/BackgroundJob/Job.php#41
Implements:OCP\BackgroundJob\IJob

Properties

protected static property OCP\BackgroundJob\Job::$id
Source:lib/public/BackgroundJob/Job.php#44
Type:int
protected static property OCP\BackgroundJob\Job::$lastRun
Source:lib/public/BackgroundJob/Job.php#47
Type:int
protected static property OCP\BackgroundJob\Job::$argument
Source:lib/public/BackgroundJob/Job.php#50
Type:mixed
protected static property OCP\BackgroundJob\Job::$time
Source:lib/public/BackgroundJob/Job.php#53
Type:\OCP\AppFramework\Utility\ITimeFactory

Methods

public OCP\BackgroundJob\Job::__construct($time)
Source:lib/public/BackgroundJob/Job.php#58
Since:15.0.0
public OCP\BackgroundJob\Job::execute($jobList, $logger=null)
The function to prepare the execution of the job.
Source:

lib/public/BackgroundJob/Job.php#71

Parameters:
Since:

15.0.0

public final OCP\BackgroundJob\Job::setId($id)
Source:lib/public/BackgroundJob/Job.php#98
Since:15.0.0
public final OCP\BackgroundJob\Job::setLastRun($lastRun)
Source:lib/public/BackgroundJob/Job.php#105
Since:15.0.0
public OCP\BackgroundJob\Job::setArgument($argument)
Source:lib/public/BackgroundJob/Job.php#112
Since:15.0.0
public final OCP\BackgroundJob\Job::getId()
Source:lib/public/BackgroundJob/Job.php#119
Since:15.0.0
public final OCP\BackgroundJob\Job::getLastRun()
Source:lib/public/BackgroundJob/Job.php#126
Since:15.0.0
public OCP\BackgroundJob\Job::getArgument()
Source:lib/public/BackgroundJob/Job.php#133
Since:15.0.0
protected abstract OCP\BackgroundJob\Job::run($argument)
The actual function that is called to run the job
Source:

lib/public/BackgroundJob/Job.php#144

Parameters:
  • $argument
Since:

15.0.0