CoolCMS API

CronJobFormTrait

Schedule form of a single cron job (`Admin:System:CronJob`, edit).

Plain types instead of a cron expression: every N minutes · daily · weekly · monthly · manual only. The fields that belong to the chosen type are validated here, the Api validates and stores the canonical text (CronFrequency::toString()) and is the authority.

Table of Contents

Methods

formatFrequency()  : string
Readable form of a stored frequency ("every 15 min", "daily at 03:30"…).
createComponentEditForm()  : Form
addCronJobFieldError()  : void
buildCronFrequency()  : CronFrequency|null
saveCronJobForm()  : bool
setCronJobFormDefaults()  : void

Methods

formatFrequency()

Readable form of a stored frequency ("every 15 min", "daily at 03:30"…).

public static formatFrequency(string $frequency, callable(string, array<string, scalar>=): string $translate) : string
Parameters
$frequency : string
$translate : callable(string, array<string, scalar>=): string

translates a key relative to the presenter domain

Return values
string

addCronJobFieldError()

private addCronJobFieldError(Form $form, string $field, string $key) : void
Parameters
$form : Form
$field : string
$key : string

saveCronJobForm()

private saveCronJobForm(ArrayHash<string|int, mixed> $values, Form $form) : bool
Parameters
$values : ArrayHash<string|int, mixed>
$form : Form
Return values
bool
On this page

Search results