‪TYPO3CMS  9.5
TYPO3\CMS\Scheduler\Execution Class Reference

Public Member Functions

 setStart ($start)
 
int getStart ()
 
 setEnd ($end)
 
int getEnd ()
 
 setInterval ($interval)
 
int getInterval ()
 
 setMultiple ($multiple)
 
bool getMultiple ()
 
 setCronCmd ($cmd)
 
string getCronCmd ()
 
 setIsNewSingleExecution ($isNewSingleExecution)
 
bool getIsNewSingleExecution ()
 
int getNextExecution ()
 
int getNextCronExecution ()
 
bool isStarted ()
 
bool isEnded ()
 

Protected Attributes

int $start
 
int $end
 
int $interval
 
bool $multiple = false
 
string $cronCmd
 
bool $isNewSingleExecution = false
 

Detailed Description

This class manages the logic of a particular execution of a task

Definition at line 21 of file Execution.php.

Member Function Documentation

◆ getCronCmd()

string TYPO3\CMS\Scheduler\Execution::getCronCmd ( )

Get the value of the cron command

Returns
‪string Cron command, using cron-like syntax

Definition at line 159 of file Execution.php.

References TYPO3\CMS\Scheduler\Execution\$cronCmd.

Referenced by TYPO3\CMS\Scheduler\Execution\getNextCronExecution().

◆ getEnd()

int TYPO3\CMS\Scheduler\Execution::getEnd ( )

This method is used to get the end date

Returns
‪int End date (timestamp)

Definition at line 99 of file Execution.php.

References TYPO3\CMS\Scheduler\Execution\$end.

◆ getInterval()

int TYPO3\CMS\Scheduler\Execution::getInterval ( )

This method is used to get the interval

Returns
‪int Interval (in seconds)

Definition at line 119 of file Execution.php.

References TYPO3\CMS\Scheduler\Execution\$interval.

◆ getIsNewSingleExecution()

bool TYPO3\CMS\Scheduler\Execution::getIsNewSingleExecution ( )

Get whether this is a newly created single execution

Returns
‪bool Is newly created single execution?

Definition at line 186 of file Execution.php.

References TYPO3\CMS\Scheduler\Execution\$isNewSingleExecution.

Referenced by TYPO3\CMS\Scheduler\Execution\getNextExecution().

◆ getMultiple()

bool TYPO3\CMS\Scheduler\Execution::getMultiple ( )

This method is used to get the multiple execution flag

Returns
‪bool TRUE if concurrent executions are allowed, FALSE otherwise

Definition at line 139 of file Execution.php.

References TYPO3\CMS\Scheduler\Execution\$multiple.

◆ getNextCronExecution()

int TYPO3\CMS\Scheduler\Execution::getNextCronExecution ( )

Calculates the next execution from a cron command

Returns
‪int Next execution (timestamp)

Definition at line 241 of file Execution.php.

References TYPO3\CMS\Scheduler\Execution\$cronCmd, and TYPO3\CMS\Scheduler\Execution\getCronCmd().

Referenced by TYPO3\CMS\Scheduler\Execution\getNextExecution().

◆ getNextExecution()

int TYPO3\CMS\Scheduler\Execution::getNextExecution ( )

◆ getStart()

int TYPO3\CMS\Scheduler\Execution::getStart ( )

This method is used to get the start date

Returns
‪int Start date (timestamp)

Definition at line 79 of file Execution.php.

References TYPO3\CMS\Scheduler\Execution\$start.

◆ isEnded()

bool TYPO3\CMS\Scheduler\Execution::isEnded ( )

Checks if the schedule for a task is passed or not

Returns
‪bool TRUE if the schedule is not active anymore, FALSE otherwise

Definition at line 264 of file Execution.php.

Referenced by TYPO3\CMS\Scheduler\Execution\getNextExecution().

◆ isStarted()

bool TYPO3\CMS\Scheduler\Execution::isStarted ( )

Checks if the schedule for a task is started or not

Returns
‪bool TRUE if the schedule is already active, FALSE otherwise

Definition at line 254 of file Execution.php.

Referenced by TYPO3\CMS\Scheduler\Execution\getNextExecution().

◆ setCronCmd()

TYPO3\CMS\Scheduler\Execution::setCronCmd (   $cmd)

Set the value of the cron command

Parameters
string$cmd‪Cron command, using cron-like syntax

Definition at line 149 of file Execution.php.

Referenced by TYPO3\CMS\Scheduler\Task\AbstractTask\registerRecurringExecution(), and TYPO3\CMS\Scheduler\Task\AbstractTask\registerSingleExecution().

◆ setEnd()

TYPO3\CMS\Scheduler\Execution::setEnd (   $end)

This method is used to set the end date

Parameters
int$end‪End date (timestamp)

Definition at line 89 of file Execution.php.

References TYPO3\CMS\Scheduler\Execution\$end.

Referenced by TYPO3\CMS\Scheduler\Task\AbstractTask\registerRecurringExecution(), and TYPO3\CMS\Scheduler\Task\AbstractTask\registerSingleExecution().

◆ setInterval()

TYPO3\CMS\Scheduler\Execution::setInterval (   $interval)

This method is used to set the interval

Parameters
int$interval‪Interval (in seconds)

Definition at line 109 of file Execution.php.

References TYPO3\CMS\Scheduler\Execution\$interval.

Referenced by TYPO3\CMS\Scheduler\Task\AbstractTask\registerRecurringExecution(), and TYPO3\CMS\Scheduler\Task\AbstractTask\registerSingleExecution().

◆ setIsNewSingleExecution()

TYPO3\CMS\Scheduler\Execution::setIsNewSingleExecution (   $isNewSingleExecution)

Set whether this is a newly created single execution. This is necessary for the following reason: if a new single-running task is created and its start date is in the past (even for only a few seconds), the next run time calculation (which happens upon saving) will disable that task, because it was meant to run only once and is in the past. Setting this flag to TRUE preserves this task for a single run. Upon next execution, this flag is set to FALSE.

Parameters
bool$isNewSingleExecution‪Is newly created single execution?
See also
‪\TYPO3\CMS\Scheduler\Execution::getNextExecution()

Definition at line 176 of file Execution.php.

References TYPO3\CMS\Scheduler\Execution\$isNewSingleExecution.

Referenced by TYPO3\CMS\Scheduler\Execution\getNextExecution(), and TYPO3\CMS\Scheduler\Task\AbstractTask\registerSingleExecution().

◆ setMultiple()

TYPO3\CMS\Scheduler\Execution::setMultiple (   $multiple)

This method is used to set the multiple execution flag

Parameters
bool$multiple‪TRUE if concurrent executions are allowed, FALSE otherwise

Definition at line 129 of file Execution.php.

References TYPO3\CMS\Scheduler\Execution\$multiple.

Referenced by TYPO3\CMS\Scheduler\Task\AbstractTask\registerRecurringExecution(), and TYPO3\CMS\Scheduler\Task\AbstractTask\registerSingleExecution().

◆ setStart()

TYPO3\CMS\Scheduler\Execution::setStart (   $start)

This method is used to set the start date

Parameters
int$start‪Start date (timestamp)

Definition at line 69 of file Execution.php.

References TYPO3\CMS\Scheduler\Execution\$start.

Referenced by TYPO3\CMS\Scheduler\Task\AbstractTask\registerRecurringExecution(), and TYPO3\CMS\Scheduler\Task\AbstractTask\registerSingleExecution().

Member Data Documentation

◆ $cronCmd

string TYPO3\CMS\Scheduler\Execution::$cronCmd
protected

The cron command string of this task,

Definition at line 51 of file Execution.php.

Referenced by TYPO3\CMS\Scheduler\Execution\getCronCmd(), and TYPO3\CMS\Scheduler\Execution\getNextCronExecution().

◆ $end

int TYPO3\CMS\Scheduler\Execution::$end
protected

◆ $interval

int TYPO3\CMS\Scheduler\Execution::$interval
protected

Interval between executions (in seconds)

Definition at line 39 of file Execution.php.

Referenced by TYPO3\CMS\Scheduler\Execution\getInterval(), and TYPO3\CMS\Scheduler\Execution\setInterval().

◆ $isNewSingleExecution

bool TYPO3\CMS\Scheduler\Execution::$isNewSingleExecution = false
protected

This flag is used to mark a new single execution See explanations in method setIsNewSingleExecution()

See also
‪\TYPO3\CMS\Scheduler\Execution::setIsNewSingleExecution()

Definition at line 59 of file Execution.php.

Referenced by TYPO3\CMS\Scheduler\Execution\getIsNewSingleExecution(), and TYPO3\CMS\Scheduler\Execution\setIsNewSingleExecution().

◆ $multiple

bool TYPO3\CMS\Scheduler\Execution::$multiple = false
protected

Flag for concurrent executions: TRUE if allowed, FALSE otherwise (default)

Definition at line 45 of file Execution.php.

Referenced by TYPO3\CMS\Scheduler\Execution\getMultiple(), and TYPO3\CMS\Scheduler\Execution\setMultiple().

◆ $start

int TYPO3\CMS\Scheduler\Execution::$start
protected