CoolCMS API

CronJob
in package

FinalYes

Marks a public `action*()` of a cron presenter as a job known to the scheduler (`/cron/system/scheduler/run`).

The scheduler catalog is built from this attribute, not from docblocks (the manual still reads the Frekvence: line of the docblock, so keep both in sync).

  • $frequency — default schedule, see CronFrequency::parse(): every:<minutes>, daily:HH:MM, weekly:<1-7>@HH:MM, monthly:<1-31>@HH:MM or manual;
  • $outbound — the job sends e-mails/SMS, issues documents, deletes or anonymises user data, calls payment gateways or notifies watchdogs. Such a job starts disabled and an administrator switches it on deliberately. Required on purpose — no default, so the decision is never skipped;
  • $query — fixed query parameters the scheduler appends to the call (e.g. ['save' => '1']).
Attributes
#[Attribute]
\Attribute::TARGET_METHOD

Table of Contents

Properties

$frequency  : string
$outbound  : bool
$query  : array<string|int, mixed>

Methods

__construct()  : mixed

Properties

$frequency read-only

public string $frequency

$outbound read-only

public bool $outbound

$query read-only

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

Methods

__construct()

public __construct(string $frequency, bool $outbound[, array<string, string> $query = [] ]) : mixed
Parameters
$frequency : string
$outbound : bool
$query : array<string, string> = []
On this page

Search results