Nextcloud PHP API (stable18)

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
since
15.0.0

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

Methods

execute()

The function to prepare the execution of the job.

public execute(IJobList $jobList[, ILogger|null $logger = null ]) : mixed
Parameters
$jobList : IJobList

The job list that manages the state of this job

$logger : ILogger|null = null
Tags
since
15.0.0
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
since
15.0.0
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
since
15.0.0
Return values
int

getLastRun()

Get the last time this job was run as unix timestamp

public final getLastRun() : int
Tags
since
15.0.0
Return values
int

setArgument()

public setArgument(mixed $argument) : mixed
Parameters
$argument : mixed
Tags
since
15.0.0
Return values
mixed

setId()

public final setId(mixed $id) : mixed
Parameters
$id : mixed
Tags
since
15.0.0
Return values
mixed

setLastRun()

public final setLastRun(mixed $lastRun) : mixed
Parameters
$lastRun : mixed
Tags
since
15.0.0
Return values
mixed

run()

The actual function that is called to run the job

protected abstract run( $argument) : mixed
Parameters
$argument :
Tags
since
15.0.0
Return values
mixed

Search results