Documentation

CRM_Core_ScheduledJob
in package

This interface defines methods that need to be implemented by every scheduled job (cron task) in CiviCRM.

Tags
copyright

CiviCRM LLC https://civicrm.org/licensing

Table of Contents

Properties

$action  : string|null
Class string
$api_action  : string
Action of the job api call
$api_entity  : string
Entity of the job api call
$apiParams  : array<string|int, mixed>
Result of parsing multi-line `$parameters` string into an array
$class  : string
Action
$description  : string
Description of the job
$domain_id  : int
Which Domain is this scheduled job for
$id  : int
Job ID
$is_active  : bool
Is this job active?
$last_run  : string
When was this cron entry last run
$name  : string
Title of the job
$parameters  : string
List of parameters to the command.
$remarks  : array<string|int, mixed>
Container for error messages
$run_frequency  : string
Scheduled job run frequency.
$scheduled_run_date  : string
When is this cron entry scheduled to run

Methods

__construct()  : mixed
clearScheduledRunDate()  : mixed
Delete the scheduled_run_date from this job
needsRunning()  : bool
saveLastRun()  : mixed
Update the last_run date of this job
saveLastRunEnd()  : mixed
Update the last_run date of this job

Properties

$action

Class string

public string|null $action = \NULL

Set as a URL, when the jobs template is rendered, but not set in other contexts

$api_action

Action of the job api call

public string $api_action

$api_entity

Entity of the job api call

public string $api_entity

$apiParams

Result of parsing multi-line `$parameters` string into an array

public array<string|int, mixed> $apiParams = []

$class

Action

public string $class
Tags
todo

This seems to only ever be set to an empty string and passed through to job.tpl, where it is used a HTML class. Can this be removed?

$description

Description of the job

public string $description

$domain_id

Which Domain is this scheduled job for

public int $domain_id

$last_run

When was this cron entry last run

public string $last_run

$parameters

List of parameters to the command.

public string $parameters

$remarks

Container for error messages

public array<string|int, mixed> $remarks = []

$run_frequency

Scheduled job run frequency.

public string $run_frequency

$scheduled_run_date

When is this cron entry scheduled to run

public string $scheduled_run_date

Methods

__construct()

public __construct(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>

clearScheduledRunDate()

Delete the scheduled_run_date from this job

public clearScheduledRunDate() : mixed

needsRunning()

public needsRunning() : bool
Return values
bool

saveLastRun()

Update the last_run date of this job

public saveLastRun() : mixed

saveLastRunEnd()

Update the last_run date of this job

public saveLastRunEnd() : mixed

        
On this page

Search results