\OCP\BackgroundJobIJobList

Interface IJobList

Summary

Methods
Constants
add()
remove()
has()
getAll()
getNext()
getById()
setLastJob()
unlockJob()
getLastJob()
setLastRun()
setExecutionTime()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

add()

add(\OCP\BackgroundJob\IJob|string  $job, mixed  $argument = null) 

Add a job to the list

Parameters

\OCP\BackgroundJob\IJob|string $job
mixed $argument

The argument to be passed to $job->run() when the job is exectured

remove()

remove(\OCP\BackgroundJob\IJob|string  $job, mixed  $argument = null) 

Remove a job from the list

Parameters

\OCP\BackgroundJob\IJob|string $job
mixed $argument

has()

has(\OCP\BackgroundJob\IJob|string  $job, mixed  $argument) : boolean

check if a job is in the list

Parameters

\OCP\BackgroundJob\IJob|string $job
mixed $argument

Returns

boolean

getAll()

getAll() : array<mixed,\OCP\BackgroundJob\IJob>

get all jobs in the list

Returns

array<mixed,\OCP\BackgroundJob\IJob>

getNext()

getNext() : \OCP\BackgroundJob\IJob|null

get the next job in the list

Returns

\OCP\BackgroundJob\IJob|null

getById()

getById(integer  $id) : \OCP\BackgroundJob\IJob|null

Parameters

integer $id

Returns

\OCP\BackgroundJob\IJob|null

setLastJob()

setLastJob(\OCP\BackgroundJob\IJob  $job) 

set the job that was last ran to the current time

Parameters

\OCP\BackgroundJob\IJob $job

unlockJob()

unlockJob(\OCP\BackgroundJob\IJob  $job) 

Remove the reservation for a job

Parameters

\OCP\BackgroundJob\IJob $job

getLastJob()

getLastJob() : integer

get the id of the last ran job

Returns

integer

setLastRun()

setLastRun(\OCP\BackgroundJob\IJob  $job) 

set the lastRun of $job to now

Parameters

\OCP\BackgroundJob\IJob $job

setExecutionTime()

setExecutionTime(\OCP\BackgroundJob\IJob  $job, integer  $timeTaken) 

set the lastRun of $job to now

Parameters

\OCP\BackgroundJob\IJob $job
integer $timeTaken