Documentation

Cron
in package

Provides API to work with Cron tasks.

Table of Contents

$STATUS_COMPLETED  : mixed
$STATUS_DISABLED  : mixed
$STATUS_ENABLED  : mixed
$STATUS_RUNNING  : mixed
$baseTable  : mixed
$cronAction  : mixed
$cronInstance  : Cron
Cron instance.
$data  : mixed
$instanceCache  : mixed
$schemaInitialized  : mixed
checkTimeout()  : bool
Check cron task timeout.
deleteForModule()  : mixed
Delete all cron tasks associated with module.
deregister()  : mixed
De-register cron task.
getDescription()  : mixed
get the description of cron.
getFrequency()  : mixed
Get the frequency set.
getHandlerClass()  : mixed
Get the configured handler file.
getId()  : mixed
Get id reference of this instance.
getInstance()  : self
Get instance of cron task.
getInstanceById()  : self
Get instance of cron job by id.
getLastEnd()  : mixed
Get the timestamp lastrun ended.
getLastEndDateTime()  : mixed
Get the user datetimefeild.
getLastStart()  : mixed
Get the timestamp lastrun started.
getLastStartDateTime()  : mixed
get the last start datetime field.
getLockStatus()  : mixed
getModule()  : mixed
Get the Module name.
getName()  : mixed
Get name of this task instance.
getSequence()  : mixed
get the Sequence.
getStatus()  : mixed
Get the status.
getTimeDiff()  : mixed
Get Time taken to complete task.
hadTimeout()  : mixed
Detect if the task was started by never finished.
isCronAction()  : bool
Function checks cron status.
isDisabled()  : mixed
Is task disabled?
isEnabled()  : mixed
Is task enabled?
isRunnable()  : mixed
Check if task is right state for running.
isRunning()  : mixed
Is task in running status?
listAllActiveInstances()  : array<string|int, self>
Get instances that are active (not disabled).
listAllInstancesByModule()  : array<string|int, self>
Get instance of cron.
markFinished()  : int
Mark this instance as finished.
markRunning()  : mixed
Mark this instance as running.
nextSequence()  : mixed
Get the next sequence.
refreshData()  : mixed
Function to refresh information about task.
register()  : mixed
Register cron task.
set()  : mixed
set the value to the data.
setCronAction()  : mixed
Function sets cron status.
setCronInstance()  : void
Set cron instance.
setError()  : void
Set error message.
statusEqual()  : mixed
Helper function to check the status value.
unlockTask()  : mixed
updateFrequency()  : mixed
Update frequency.
updateStatus()  : mixed
Update status.
__construct()  : mixed
Constructor.

Properties

$STATUS_COMPLETED

public static mixed $STATUS_COMPLETED = 3

$STATUS_DISABLED

public static mixed $STATUS_DISABLED = 0

$STATUS_ENABLED

public static mixed $STATUS_ENABLED = 1

$STATUS_RUNNING

public static mixed $STATUS_RUNNING = 2

$baseTable

protected static mixed $baseTable = 'vtiger_cron_task'

$cronAction

protected static mixed $cronAction = false

$cronInstance

Cron instance.

protected Cron $cronInstance

$data

protected mixed $data

$instanceCache

protected static mixed $instanceCache = []

$schemaInitialized

protected static mixed $schemaInitialized = false

Methods

checkTimeout()

Check cron task timeout.

public checkTimeout() : bool
Return values
bool

deleteForModule()

Delete all cron tasks associated with module.

public static deleteForModule(ModuleBasic $moduleInstance) : mixed
Parameters
$moduleInstance : ModuleBasic
Return values
mixed

deregister()

De-register cron task.

public static deregister(string $name) : mixed
Parameters
$name : string
Return values
mixed

getDescription()

get the description of cron.

public getDescription() : mixed
Return values
mixed

getFrequency()

Get the frequency set.

public getFrequency() : mixed
Return values
mixed

getHandlerClass()

Get the configured handler file.

public getHandlerClass() : mixed
Return values
mixed

getId()

Get id reference of this instance.

public getId() : mixed
Return values
mixed

getInstance()

Get instance of cron task.

public static getInstance(string $name) : self
Parameters
$name : string
Return values
self

getInstanceById()

Get instance of cron job by id.

public static getInstanceById(int $id) : self
Parameters
$id : int
Return values
self

getLastEnd()

Get the timestamp lastrun ended.

public getLastEnd() : mixed
Return values
mixed

getLastEndDateTime()

Get the user datetimefeild.

public getLastEndDateTime() : mixed
Return values
mixed

getLastStart()

Get the timestamp lastrun started.

public getLastStart() : mixed
Return values
mixed

getLastStartDateTime()

get the last start datetime field.

public getLastStartDateTime() : mixed
Return values
mixed

getLockStatus()

public getLockStatus() : mixed
Return values
mixed

getModule()

Get the Module name.

public getModule() : mixed
Return values
mixed

getName()

Get name of this task instance.

public getName() : mixed
Return values
mixed

getSequence()

get the Sequence.

public getSequence() : mixed
Return values
mixed

getStatus()

Get the status.

public getStatus() : mixed
Return values
mixed

getTimeDiff()

Get Time taken to complete task.

public getTimeDiff() : mixed
Return values
mixed

hadTimeout()

Detect if the task was started by never finished.

public hadTimeout() : mixed
Return values
mixed

isCronAction()

Function checks cron status.

public static isCronAction() : bool
Return values
bool

isDisabled()

Is task disabled?

public isDisabled() : mixed
Return values
mixed

isEnabled()

Is task enabled?

public isEnabled() : mixed
Return values
mixed

isRunnable()

Check if task is right state for running.

public isRunnable() : mixed
Return values
mixed

isRunning()

Is task in running status?

public isRunning() : mixed
Return values
mixed

listAllActiveInstances()

Get instances that are active (not disabled).

public static listAllActiveInstances() : array<string|int, self>
Return values
array<string|int, self>

listAllInstancesByModule()

Get instance of cron.

public static listAllInstancesByModule(string $moduleName) : array<string|int, self>
Parameters
$moduleName : string
Return values
array<string|int, self>

markFinished()

Mark this instance as finished.

public markFinished() : int
Return values
int

markRunning()

Mark this instance as running.

public markRunning() : mixed
Return values
mixed

nextSequence()

Get the next sequence.

public static nextSequence() : mixed
Return values
mixed

refreshData()

Function to refresh information about task.

public refreshData() : mixed
Return values
mixed

register()

Register cron task.

public static register(string $name, string $handlerClass, int $frequency[, string $module = 'Home' ][, int $status = 1 ], int $sequence[, string $description = '' ]) : mixed
Parameters
$name : string
$handlerClass : string
$frequency : int
$module : string = 'Home'
$status : int = 1
$sequence : int
$description : string = ''
Return values
mixed

set()

set the value to the data.

public set(mixed $key, type $value) : mixed
Parameters
$key : mixed
$value : type

,$key

Return values
mixed

setCronAction()

Function sets cron status.

public static setCronAction(bool $status) : mixed
Parameters
$status : bool
Return values
mixed

setCronInstance()

Set cron instance.

public setCronInstance(Cron $cronInstance) : void
Parameters
$cronInstance : Cron
Return values
void

setError()

Set error message.

public setError(string $errorMessage) : void
Parameters
$errorMessage : string
Return values
void

statusEqual()

Helper function to check the status value.

public statusEqual(mixed $value) : mixed
Parameters
$value : mixed
Return values
mixed

unlockTask()

public unlockTask() : mixed
Return values
mixed

updateFrequency()

Update frequency.

public updateFrequency(int $frequency) : mixed
Parameters
$frequency : int
Return values
mixed

updateStatus()

Update status.

public updateStatus(int $status) : mixed
Parameters
$status : int
Tags
throws
Exception
Return values
mixed

__construct()

Constructor.

protected __construct(mixed $values) : mixed
Parameters
$values : mixed
Return values
mixed

        

Search results