TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Scheduler\Task\AbstractTask Class Reference
Inheritance diagram for TYPO3\CMS\Scheduler\Task\AbstractTask:
tx_scheduler_Task TYPO3\CMS\Extbase\Scheduler\Task TYPO3\CMS\Extensionmanager\Task\UpdateExtensionListTask TYPO3\CMS\Linkvalidator\Task\ValidatorTask TYPO3\CMS\Reports\Task\SystemStatusUpdateTask TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask TYPO3\CMS\Scheduler\Example\SleepTask TYPO3\CMS\Scheduler\Example\TestTask TYPO3\CMS\Scheduler\Task\CachingFrameworkGarbageCollectionTask TYPO3\CMS\Scheduler\Task\FileIndexingTask TYPO3\CMS\Scheduler\Task\FileStorageExtractionTask TYPO3\CMS\Scheduler\Task\FileStorageIndexingTask TYPO3\CMS\Scheduler\Task\RecyclerGarbageCollectionTask TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask TYPO3\CMS\Version\Task\AutoPublishTask TYPO3\CMS\Workspaces\Task\AutoPublishTask TYPO3\CMS\Workspaces\Task\CleanupPreviewLinkTask

Public Member Functions

 __construct ()
 
 execute ()
 
 getAdditionalInformation ()
 
 setTaskUid ($id)
 
 getTaskUid ()
 
 getTaskTitle ()
 
 getTaskDescription ()
 
 getTaskClassName ()
 
 isDisabled ()
 
 setDisabled ($flag)
 
 setExecutionTime ($timestamp)
 
 getTaskGroup ()
 
 setTaskGroup ($taskGroup)
 
 getExecutionTime ()
 
 setDescription ($description)
 
 getDescription ()
 
 setScheduler ()
 
 unsetScheduler ()
 
 setExecution (\TYPO3\CMS\Scheduler\Execution $execution)
 
 getExecution ()
 
 getNextDueExecution ()
 
 areMultipleExecutionsAllowed ()
 
 isExecutionRunning ()
 
 markExecution ()
 
 unmarkExecution ($executionID, \Exception $failure=NULL)
 
 unmarkAllExecutions ()
 
 save ()
 
 stop ()
 
 remove ()
 

Protected Attributes

 $scheduler
 
 $taskUid
 
 $disabled = FALSE
 
 $execution
 
 $executionTime = 0
 
 $description = ''
 
 $taskGroup
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! 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

Author
François Suter franc.nosp@m.ois@.nosp@m.typo3.nosp@m..org
Christian Jul Jensen julle.nosp@m.@typ.nosp@m.o3.or.nosp@m.g

Definition at line 24 of file AbstractTask.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Scheduler\Task\AbstractTask::__construct ( )

Member Function Documentation

◆ areMultipleExecutionsAllowed()

TYPO3\CMS\Scheduler\Task\AbstractTask::areMultipleExecutionsAllowed ( )

Returns TRUE if several runs of the task are allowed concurrently

Returns
boolean TRUE if concurrent executions are allowed, FALSE otherwise

Definition at line 333 of file AbstractTask.php.

◆ execute()

TYPO3\CMS\Scheduler\Task\AbstractTask::execute ( )
abstract

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. Should return TRUE on successful execution, FALSE on error.

Returns
boolean Returns TRUE on successful execution, FALSE on error

Referenced by TYPO3\CMS\Scheduler\Task\AbstractTask\__construct().

◆ getAdditionalInformation()

TYPO3\CMS\Scheduler\Task\AbstractTask::getAdditionalInformation ( )

This method is designed to return some additional information about the task, that may help to set it apart from other tasks from the same class This additional information is used - for example - in the Scheduler's BE module This method should be implemented in most task classes

Returns
string Information to display

Definition at line 102 of file AbstractTask.php.

◆ getDescription()

TYPO3\CMS\Scheduler\Task\AbstractTask::getDescription ( )

This method returns the description of the task

Returns
string Description

Definition at line 228 of file AbstractTask.php.

References TYPO3\CMS\Scheduler\Task\AbstractTask\$description.

◆ getExecution()

TYPO3\CMS\Scheduler\Task\AbstractTask::getExecution ( )

Returns the execution object

Returns
The internal execution object

Definition at line 314 of file AbstractTask.php.

References TYPO3\CMS\Scheduler\Task\AbstractTask\$execution.

◆ getExecutionTime()

TYPO3\CMS\Scheduler\Task\AbstractTask::getExecutionTime ( )

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

Returns
integer Timestamp of next execution

Definition at line 209 of file AbstractTask.php.

References TYPO3\CMS\Scheduler\Task\AbstractTask\$executionTime.

◆ getNextDueExecution()

TYPO3\CMS\Scheduler\Task\AbstractTask::getNextDueExecution ( )

Returns the timestamp for next due execution of the task

Returns
integer Date and time of the next execution as a timestamp

Definition at line 323 of file AbstractTask.php.

◆ getTaskClassName()

TYPO3\CMS\Scheduler\Task\AbstractTask::getTaskClassName ( )

This method returns the class name of the scheduler task

Returns
string

Definition at line 148 of file AbstractTask.php.

◆ getTaskDescription()

TYPO3\CMS\Scheduler\Task\AbstractTask::getTaskDescription ( )

This method returns the description of the scheduler task

Returns
string

Definition at line 139 of file AbstractTask.php.

References $GLOBALS.

◆ getTaskGroup()

TYPO3\CMS\Scheduler\Task\AbstractTask::getTaskGroup ( )

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

Returns
integer Uid of task group

Definition at line 190 of file AbstractTask.php.

References TYPO3\CMS\Scheduler\Task\AbstractTask\$taskGroup.

◆ getTaskTitle()

TYPO3\CMS\Scheduler\Task\AbstractTask::getTaskTitle ( )

This method returns the title of the scheduler task

Returns
string

Definition at line 130 of file AbstractTask.php.

References $GLOBALS.

◆ getTaskUid()

TYPO3\CMS\Scheduler\Task\AbstractTask::getTaskUid ( )

This method returns the unique id of the task

Returns
integer The id of the task

Definition at line 121 of file AbstractTask.php.

References TYPO3\CMS\Scheduler\Task\AbstractTask\$taskUid.

◆ isDisabled()

TYPO3\CMS\Scheduler\Task\AbstractTask::isDisabled ( )

This method returns the disable status of the task

Returns
boolean TRUE if task is disabled, FALSE otherwise

Definition at line 157 of file AbstractTask.php.

References TYPO3\CMS\Scheduler\Task\AbstractTask\$disabled.

◆ isExecutionRunning()

TYPO3\CMS\Scheduler\Task\AbstractTask::isExecutionRunning ( )

Returns TRUE if an instance of the task is already running

Returns
boolean TRUE if an instance is already running, FALSE otherwise

Definition at line 342 of file AbstractTask.php.

References $GLOBALS.

◆ markExecution()

TYPO3\CMS\Scheduler\Task\AbstractTask::markExecution ( )

This method adds current execution to the execution list It also logs the execution time and mode

Returns
integer Execution id

Definition at line 366 of file AbstractTask.php.

References $GLOBALS.

◆ remove()

TYPO3\CMS\Scheduler\Task\AbstractTask::remove ( )

Removes the task totally from the system.

Returns
void

Definition at line 487 of file AbstractTask.php.

◆ save()

TYPO3\CMS\Scheduler\Task\AbstractTask::save ( )

Saves the details of the task to the database.

Returns
boolean

Definition at line 468 of file AbstractTask.php.

Referenced by TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\execute(), and TYPO3\CMS\Linkvalidator\Task\ValidatorTask\execute().

◆ setDescription()

TYPO3\CMS\Scheduler\Task\AbstractTask::setDescription (   $description)

This method is used to set the description of the task

Parameters
string$descriptionDescription
Returns
void

Definition at line 219 of file AbstractTask.php.

References TYPO3\CMS\Scheduler\Task\AbstractTask\$description.

◆ setDisabled()

TYPO3\CMS\Scheduler\Task\AbstractTask::setDisabled (   $flag)

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

Parameters
boolean$flagTRUE if task should be disabled, FALSE otherwise
Returns
void

Definition at line 167 of file AbstractTask.php.

Referenced by TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\activateSelf(), and TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\deactivateSelf().

◆ setExecution()

TYPO3\CMS\Scheduler\Task\AbstractTask::setExecution ( \TYPO3\CMS\Scheduler\Execution  $execution)

Sets the internal execution object

Parameters
\TYPO3\CMS\Scheduler\Execution$executionThe execution to add

Definition at line 305 of file AbstractTask.php.

References TYPO3\CMS\Scheduler\Task\AbstractTask\$execution.

◆ setExecutionTime()

TYPO3\CMS\Scheduler\Task\AbstractTask::setExecutionTime (   $timestamp)

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

Parameters
integer$timestampTimestamp of next execution
Returns
void

Definition at line 181 of file AbstractTask.php.

◆ setScheduler()

TYPO3\CMS\Scheduler\Task\AbstractTask::setScheduler ( )

Sets the internal reference to the singleton instance of the Scheduler

Returns
void

Definition at line 237 of file AbstractTask.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Scheduler\Task\AbstractTask\__construct().

◆ setTaskGroup()

TYPO3\CMS\Scheduler\Task\AbstractTask::setTaskGroup (   $taskGroup)

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

Parameters
integer$timestampUid of task group
Returns
void

Definition at line 200 of file AbstractTask.php.

References TYPO3\CMS\Scheduler\Task\AbstractTask\$taskGroup.

◆ setTaskUid()

TYPO3\CMS\Scheduler\Task\AbstractTask::setTaskUid (   $id)

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

Parameters
integer$idPrimary key (from the database record) of the scheduled task
Returns
void

Definition at line 112 of file AbstractTask.php.

◆ stop()

TYPO3\CMS\Scheduler\Task\AbstractTask::stop ( )

Stops the task, by replacing the execution object by an empty one NOTE: the task still needs to be saved after that

Returns
void

Definition at line 478 of file AbstractTask.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ unmarkAllExecutions()

TYPO3\CMS\Scheduler\Task\AbstractTask::unmarkAllExecutions ( )

Clears all marked executions

Returns
boolean TRUE if the clearing succeeded, FALSE otherwise

Definition at line 455 of file AbstractTask.php.

References $GLOBALS, and $result.

◆ unmarkExecution()

TYPO3\CMS\Scheduler\Task\AbstractTask::unmarkExecution (   $executionID,
\Exception  $failure = NULL 
)

Removes given execution from list

Parameters
integer$executionIDId of the execution to remove.
\Exception$failureAn exception to signal a failed execution
Returns
void

Definition at line 405 of file AbstractTask.php.

References $GLOBALS.

◆ unsetScheduler()

TYPO3\CMS\Scheduler\Task\AbstractTask::unsetScheduler ( )

Unsets the internal reference to the singleton instance of the Scheduler This is done before a task is serialized, so that the scheduler instance is not saved to the database too

Returns
void

Definition at line 248 of file AbstractTask.php.

References TYPO3\CMS\Scheduler\Task\AbstractTask\$execution, and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Member Data Documentation

◆ $description

TYPO3\CMS\Scheduler\Task\AbstractTask::$description = ''
protected

◆ $disabled

TYPO3\CMS\Scheduler\Task\AbstractTask::$disabled = FALSE
protected

Definition at line 45 of file AbstractTask.php.

Referenced by TYPO3\CMS\Scheduler\Task\AbstractTask\isDisabled().

◆ $execution

◆ $executionTime

TYPO3\CMS\Scheduler\Task\AbstractTask::$executionTime = 0
protected

◆ $scheduler

TYPO3\CMS\Scheduler\Task\AbstractTask::$scheduler
protected

Definition at line 31 of file AbstractTask.php.

◆ $taskGroup

TYPO3\CMS\Scheduler\Task\AbstractTask::$taskGroup
protected

◆ $taskUid

TYPO3\CMS\Scheduler\Task\AbstractTask::$taskUid
protected

Definition at line 38 of file AbstractTask.php.

Referenced by TYPO3\CMS\Scheduler\Task\AbstractTask\getTaskUid().