ExecuteSchedulableCommandTask

class \TYPO3\CMS\Scheduler\Task\ExecuteSchedulableCommandTask

Extends
AbstractTask

This is the base class for all Scheduler tasks It's an abstract class, not designed to be instantiated directly All Scheduler tasks should inherit from this class

Table of Contents

Constants

TYPE_RECURRING  : mixed = 2
TYPE_SINGLE  : mixed = 1

Properties

$arguments  : array
$commandIdentifier  : string
$defaults  : array
$description  : string
Description for the task
$disabled  : bool
Disable flag, TRUE if task is disabled, FALSE otherwise
$execution  : Execution
The execution object related to the task
$executionTime  : int
This variable contains the time of next execution of the task
$options  : array
$optionValues  : array
$runOnNextCronJob  : bool
Run on next cron job flag, TRUE if task should run on next cronjob, FALSE otherwise
$taskGroup  : int|null
Task group for this task
$taskUid  : int
The unique id of the task used to identify it in the database.

Methods

__construct()  : mixed
addDefaultValue()  : void
execute()  : bool
This is the main method that is called when a task is executed It MUST be implemented by all classes inheriting from this one Note that there is no error handling, errors and failures are expected to be handled and logged by the client implementations.
getAdditionalInformation()  : string
Return a text representation of the selected command and arguments
getArguments()  : array
getDescription()  : string
This method returns the description of the task
getExecution()  : Execution|object|null
Returns the execution object
getExecutionTime()  : int
This method returns the timestamp corresponding to the next execution time of the task
getOptions()  : array
getOptionValues()  : array
getRunOnNextCronJob()  : bool
This method returns the run on next cron job status of the task
getTaskGroup()  : int|null
This method returns the task group (uid) of the task
getTaskParameters()  : array
It is recommended to implement this method in the respective task class.
getTaskType()  : string
getTaskUid()  : int
This method returns the unique id of the task
getType()  : int
Guess recurring type from the existing information If an interval or a cron command is defined, it's a recurring task
isDisabled()  : bool
This method returns the disabled status of the task
setDescription()  : void
This method is used to set the description of the task
setDisabled()  : mixed
This method is used to set the disabled status of the task
setExecution()  : void
Sets the internal execution object
setExecutionTime()  : mixed
This method is used to set the timestamp corresponding to the next execution time of the task
setRunOnNextCronJob()  : mixed
This method set the flag for next cron job execution
setTaskGroup()  : mixed
This method is used to set the task group (uid) of the task
setTaskParameters()  : void
Used to fill fields of this class, e.g. also when instantiating this class when no parameters are given but native DB fields are coming in.
setTaskType()  : void
setTaskUid()  : void
This method is used to set the unique id of the task
validateTaskParameters()  : bool
getLanguageService()  : LanguageService|null
logException()  : mixed
processArguments()  : array
processOptions()  : array

Constants

TYPE_RECURRING

public mixed TYPE_RECURRING = 2

Properties

$commandIdentifier

protected string $commandIdentifier = ''

$description

Description for the task

protected string $description = ''

$disabled

Disable flag, TRUE if task is disabled, FALSE otherwise

protected bool $disabled = false

$executionTime

This variable contains the time of next execution of the task

protected int $executionTime = 0

$optionValues

protected array $optionValues = []

$runOnNextCronJob

Run on next cron job flag, TRUE if task should run on next cronjob, FALSE otherwise

protected bool $runOnNextCronJob = false

$taskGroup

Task group for this task

protected int|null $taskGroup = 0

$taskUid

The unique id of the task used to identify it in the database.

protected int $taskUid = 0

Methods

addDefaultValue()

public addDefaultValue(string $argumentName, mixed $argumentValue) : void

Parameters

$argumentName : string
$argumentValue : mixed

execute()

This is the main method that is called when a task is executed It MUST be implemented by all classes inheriting from this one Note that there is no error handling, errors and failures are expected to be handled and logged by the client implementations.

public execute() : bool

Should return TRUE on successful execution, FALSE on error.

Tags

throws
Exception

Return values

bool —

Returns TRUE on successful execution, FALSE on error

getAdditionalInformation()

Return a text representation of the selected command and arguments

public getAdditionalInformation() : string

Return values

string —

Information to display

getArguments()

public getArguments() : array

Return values

array

getDescription()

This method returns the description of the task

public getDescription() : string

Return values

string —

Description

getExecution()

Returns the execution object

public getExecution() : Execution|object|null

Return values

Execution|object|null —

The internal execution object - when an invalid task is being unserialized, the Execution object might not be available

getExecutionTime()

This method returns the timestamp corresponding to the next execution time of the task

public getExecutionTime() : int

Return values

int —

Timestamp of next execution

getOptions()

public getOptions() : array

Return values

array

getOptionValues()

public getOptionValues() : array

Return values

array

getRunOnNextCronJob()

This method returns the run on next cron job status of the task

public getRunOnNextCronJob() : bool

Return values

bool —

TRUE if task should run on next cron job, FALSE otherwise

getTaskGroup()

This method returns the task group (uid) of the task

public getTaskGroup() : int|null

Return values

int|null —

Uid of task group or null if it came back from the DB without the task group set.

getTaskParameters()

It is recommended to implement this method in the respective task class.

public getTaskParameters() : array

Return values

array

getTaskType()

public getTaskType() : string

Return values

string

getTaskUid()

This method returns the unique id of the task

public getTaskUid() : int

Return values

int —

The id of the task

getType()

Guess recurring type from the existing information If an interval or a cron command is defined, it's a recurring task

public getType() : int

Return values

int

isDisabled()

This method returns the disabled status of the task

public isDisabled() : bool

Return values

bool —

TRUE if task is disabled, FALSE otherwise

setDescription()

This method is used to set the description of the task

public setDescription(string $description) : void

Parameters

$description : string

Description

setDisabled()

This method is used to set the disabled status of the task

public setDisabled(bool $flag) : mixed

Parameters

$flag : bool

TRUE if task should be disabled, FALSE otherwise

setExecution()

Sets the internal execution object

public setExecution(Execution $execution) : void

Parameters

$execution : Execution

The execution to add

setExecutionTime()

This method is used to set the timestamp corresponding to the next execution time of the task

public setExecutionTime(int $timestamp) : mixed

Parameters

$timestamp : int

Timestamp of next execution

setRunOnNextCronJob()

This method set the flag for next cron job execution

public setRunOnNextCronJob(bool $flag) : mixed

Parameters

$flag : bool

TRUE if task should run with the next cron job, FALSE otherwise

setTaskGroup()

This method is used to set the task group (uid) of the task

public setTaskGroup(int $taskGroup) : mixed

Parameters

$taskGroup : int

Uid of task group

setTaskParameters()

Used to fill fields of this class, e.g. also when instantiating this class when no parameters are given but native DB fields are coming in.

public setTaskParameters(array $parameters) : void

Parameters

$parameters : array

setTaskType()

public setTaskType(string $taskType) : void

Parameters

$taskType : string

setTaskUid()

This method is used to set the unique id of the task

public setTaskUid(int $id) : void

Parameters

$id : int

Primary key (from the database record) of the scheduled task

validateTaskParameters()

public validateTaskParameters(array $parameters) : bool

Parameters

$parameters : array

Return values

bool

logException()

protected logException(Exception $e) : mixed

Parameters

$e : Exception

processArguments()

protected processArguments(array $paremeters) : array

Parameters

$paremeters : array

Return values

array

processOptions()

protected processOptions(array $parameters) : array

Parameters

$parameters : array

Return values

array
On this page