CronJob
extends CronJob
in package
Cron job known to the scheduler (`cms_system_cron_jobs`).
The catalog of jobs lives in code (CronJob); the row only holds
what an administrator can change (frequency, enabled) and what the scheduler records
(lastRunTime, lastStatus, …). path is the key (/cron/system/log/purge-old).
Rows are created and updated by the scheduler, never through the generic Api save/delete.
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_system_cron_jobs'
- #[TableAlias]
- 'cronJob'
Table of Contents
Properties
- $available : bool
- $defaultFrequency : string
- $enabled : bool
- $frequency : string
- $id : int|null
- $lastDurationMs : int|null
- $lastResponse : string|null
- $lastRunTime : DateTime|null
- $lastStatus : string|null
- $moduleId : int|null
- $outbound : bool
- $path : string
Methods
- __construct() : mixed
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getAvailable() : bool
- getDefaultFrequency() : string
- getEnabled() : bool
- getFrequency() : string
- getId() : int|null
- getLastDurationMs() : int|null
- getLastResponse() : string|null
- getLastRunTime() : DateTime|null
- getLastStatus() : string|null
- getModuleId() : int|null
- getOutbound() : bool
- getPath() : string
- isPersisted() : bool
- setAvailable() : $this
- setDefaultFrequency() : $this
- setEnabled() : $this
- setFrequency() : $this
- setId() : $this
- setLastDurationMs() : $this
- setLastResponse() : $this
- setLastRunTime() : $this
- setLastStatus() : $this
- setModuleId() : $this
- setOutbound() : $this
- setPath() : $this
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$available
protected
bool
$available
= true
Attributes
- #[Column]
- $name: 'available'
- $type: 'boolean'
- $options: ['default' => true]
- #[FieldAccess]
- $read: Audience::All
- $insert: Audience::None
- $update: Audience::None
$defaultFrequency
protected
string
$defaultFrequency
= 'manual'
Attributes
- #[Column]
- $name: 'default_frequency'
- $type: 'string'
- $length: 40
- #[FieldAccess]
- $read: Audience::All
- $insert: Audience::None
- $update: Audience::None
$enabled
protected
bool
$enabled
= true
Attributes
- #[Column]
- $name: 'enabled'
- $type: 'boolean'
- $options: ['default' => true]
$frequency
protected
string
$frequency
= 'manual'
Attributes
- #[Column]
- $name: 'frequency'
- $type: 'string'
- $length: 40
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'cron_job_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$lastDurationMs
protected
int|null
$lastDurationMs
= null
Attributes
- #[Column]
- $name: 'last_duration_ms'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
- #[FieldAccess]
- $read: Audience::All
- $insert: Audience::None
- $update: Audience::None
$lastResponse
protected
string|null
$lastResponse
= null
Attributes
- #[Column]
- $name: 'last_response'
- $type: 'string'
- $length: 500
- $nullable: true
- #[FieldAccess]
- $read: Audience::All
- $insert: Audience::None
- $update: Audience::None
$lastRunTime
protected
DateTime|null
$lastRunTime
= null
Attributes
- #[Column]
- $name: 'last_run_time'
- $type: 'datetime'
- $nullable: true
- #[FieldAccess]
- $read: Audience::All
- $insert: Audience::None
- $update: Audience::None
$lastStatus
protected
string|null
$lastStatus
= null
Attributes
- #[Column]
- $name: 'last_status'
- $type: 'string'
- $length: 10
- $nullable: true
- #[FieldAccess]
- $read: Audience::All
- $insert: Audience::None
- $update: Audience::None
$moduleId
protected
int|null
$moduleId
= null
Attributes
- #[Column]
- $name: 'module_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
- #[FieldAccess]
- $read: Audience::All
- $insert: Audience::None
- $update: Audience::None
$outbound
protected
bool
$outbound
= false
Attributes
- #[Column]
- $name: 'outbound'
- $type: 'boolean'
- $options: ['default' => false]
- #[FieldAccess]
- $read: Audience::All
- $insert: Audience::None
- $update: Audience::None
$path
protected
string
$path
= ''
Attributes
- #[Column]
- $name: 'path'
- $type: 'string'
- $length: 120
- $unique: true
- #[FieldAccess]
- $read: Audience::All
- $insert: Audience::None
- $update: Audience::None
Methods
__construct()
public
__construct([int|null $id = null ][, int|null $moduleId = null ][, string $path = '' ][, string $frequency = 'manual' ][, string $defaultFrequency = 'manual' ][, bool $enabled = true ][, bool $outbound = false ][, bool $available = true ][, DateTime|null $lastRunTime = null ][, string|null $lastStatus = null ][, int|null $lastDurationMs = null ][, string|null $lastResponse = null ]) : mixed
Parameters
- $id : int|null = null
- $moduleId : int|null = null
- $path : string = ''
- $frequency : string = 'manual'
- $defaultFrequency : string = 'manual'
- $enabled : bool = true
- $outbound : bool = false
- $available : bool = true
- $lastRunTime : DateTime|null = null
- $lastStatus : string|null = null
- $lastDurationMs : int|null = null
- $lastResponse : string|null = null
callInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
getAllTraits()
Returns all traits the class uses, including those used by parent classes and nested traits.
public
getAllTraits() : array<string, string>
Return values
array<string, string>getAvailable()
public
getAvailable() : bool
Return values
boolgetDefaultFrequency()
public
getDefaultFrequency() : string
Return values
stringgetEnabled()
public
getEnabled() : bool
Return values
boolgetFrequency()
public
getFrequency() : string
Return values
stringgetId()
public
getId() : int|null
Return values
int|nullgetLastDurationMs()
public
getLastDurationMs() : int|null
Return values
int|nullgetLastResponse()
public
getLastResponse() : string|null
Return values
string|nullgetLastRunTime()
public
getLastRunTime() : DateTime|null
Return values
DateTime|nullgetLastStatus()
public
getLastStatus() : string|null
Return values
string|nullgetModuleId()
public
getModuleId() : int|null
Return values
int|nullgetOutbound()
public
getOutbound() : bool
Return values
boolgetPath()
public
getPath() : string
Return values
stringisPersisted()
public
isPersisted() : bool
Return values
boolsetAvailable()
public
setAvailable(bool $available) : $this
Parameters
- $available : bool
Return values
$thissetDefaultFrequency()
public
setDefaultFrequency(string $defaultFrequency) : $this
Parameters
- $defaultFrequency : string
Return values
$thissetEnabled()
public
setEnabled(bool $enabled) : $this
Parameters
- $enabled : bool
Return values
$thissetFrequency()
public
setFrequency(string $frequency) : $this
Parameters
- $frequency : string
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetLastDurationMs()
public
setLastDurationMs(int|null $lastDurationMs) : $this
Parameters
- $lastDurationMs : int|null
Return values
$thissetLastResponse()
public
setLastResponse(string|null $lastResponse) : $this
Parameters
- $lastResponse : string|null
Return values
$thissetLastRunTime()
public
setLastRunTime(DateTime|null $lastRunTime) : $this
Parameters
- $lastRunTime : DateTime|null
Return values
$thissetLastStatus()
public
setLastStatus(string|null $lastStatus) : $this
Parameters
- $lastStatus : string|null
Return values
$thissetModuleId()
public
setModuleId(int|null $moduleId) : $this
Parameters
- $moduleId : int|null
Return values
$thissetOutbound()
public
setOutbound(bool $outbound) : $this
Parameters
- $outbound : bool
Return values
$thissetPath()
public
setPath(string $path) : $this
Parameters
- $path : string
Return values
$thisgetTraitsRecursive()
Walks the trait list recursively and collects nested traits too.
private
static getTraitsRecursive(array<string, string> $traits) : array<string, string>
Parameters
- $traits : array<string, string>