TYPO3  7.6
Public Member Functions | Protected Attributes | List of all members
AbstractTask Class Reference
Inheritance diagram for AbstractTask:
Task UpdateExtensionListTask ValidatorTask CleanerTask SystemStatusUpdateTask BulkUpdateTask SleepTask TestTask CachingFrameworkGarbageCollectionTask FileStorageExtractionTask FileStorageIndexingTask OptimizeDatabaseTableTask RecyclerGarbageCollectionTask TableGarbageCollectionTask AutoPublishTask AutoPublishTask 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 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

Definition at line 22 of file scheduler/Classes/Task/AbstractTask.php.

Constructor & Destructor Documentation

__construct ( )

Constructor

Definition at line 76 of file scheduler/Classes/Task/AbstractTask.php.

References AbstractTask\setScheduler().

Member Function Documentation

areMultipleExecutionsAllowed ( )

Returns TRUE if several runs of the task are allowed concurrently

Returns
bool TRUE if concurrent executions are allowed, FALSE otherwise

Definition at line 353 of file scheduler/Classes/Task/AbstractTask.php.

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
bool Returns TRUE on successful execution, FALSE on error
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 101 of file scheduler/Classes/Task/AbstractTask.php.

getDescription ( )

This method returns the description of the task

Returns
string Description

Definition at line 240 of file scheduler/Classes/Task/AbstractTask.php.

References AbstractTask\$description.

getExecution ( )

Returns the execution object

Returns
The internal execution object

Definition at line 332 of file scheduler/Classes/Task/AbstractTask.php.

References AbstractTask\$execution.

getExecutionTime ( )

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

Returns
int Timestamp of next execution

Definition at line 219 of file scheduler/Classes/Task/AbstractTask.php.

References AbstractTask\$executionTime.

getNextDueExecution ( )

Returns the timestamp for next due execution of the task

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

Definition at line 342 of file scheduler/Classes/Task/AbstractTask.php.

getTaskClassName ( )

This method returns the class name of the scheduler task

Returns
string

Definition at line 152 of file scheduler/Classes/Task/AbstractTask.php.

getTaskDescription ( )

This method returns the description of the scheduler task

Returns
string

Definition at line 142 of file scheduler/Classes/Task/AbstractTask.php.

References $GLOBALS.

getTaskGroup ( )

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

Returns
int Uid of task group

Definition at line 198 of file scheduler/Classes/Task/AbstractTask.php.

References AbstractTask\$taskGroup.

getTaskTitle ( )

This method returns the title of the scheduler task

Returns
string

Definition at line 132 of file scheduler/Classes/Task/AbstractTask.php.

References $GLOBALS.

getTaskUid ( )

This method returns the unique id of the task

Returns
int The id of the task

Definition at line 122 of file scheduler/Classes/Task/AbstractTask.php.

References AbstractTask\$taskUid.

isDisabled ( )

This method returns the disable status of the task

Returns
bool TRUE if task is disabled, FALSE otherwise

Definition at line 162 of file scheduler/Classes/Task/AbstractTask.php.

References AbstractTask\$disabled.

isExecutionRunning ( )

Returns TRUE if an instance of the task is already running

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

Definition at line 363 of file scheduler/Classes/Task/AbstractTask.php.

References $GLOBALS.

markExecution ( )

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

Returns
int Execution id

Definition at line 388 of file scheduler/Classes/Task/AbstractTask.php.

References $GLOBALS.

remove ( )

Removes the task totally from the system.

Returns
void

Definition at line 514 of file scheduler/Classes/Task/AbstractTask.php.

save ( )

Saves the details of the task to the database.

Returns
bool

Definition at line 493 of file scheduler/Classes/Task/AbstractTask.php.

Referenced by BulkUpdateTask\execute(), and ValidatorTask\execute().

setDescription (   $description)

This method is used to set the description of the task

Parameters
string$descriptionDescription
Returns
void

Definition at line 230 of file scheduler/Classes/Task/AbstractTask.php.

References AbstractTask\$description.

setDisabled (   $flag)

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

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

Definition at line 173 of file scheduler/Classes/Task/AbstractTask.php.

Referenced by BulkUpdateTask\activateSelf(), and BulkUpdateTask\deactivateSelf().

setExecution ( \TYPO3\CMS\Scheduler\Execution  $execution)

Sets the internal execution object

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

Definition at line 322 of file scheduler/Classes/Task/AbstractTask.php.

References AbstractTask\$execution.

setExecutionTime (   $timestamp)

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

Parameters
int$timestampTimestamp of next execution
Returns
void

Definition at line 188 of file scheduler/Classes/Task/AbstractTask.php.

setScheduler ( )

Sets the internal reference to the singleton instance of the Scheduler

Returns
void

Definition at line 250 of file scheduler/Classes/Task/AbstractTask.php.

Referenced by AbstractTask\__construct().

setTaskGroup (   $taskGroup)

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

Parameters
int$timestampUid of task group
Returns
void

Definition at line 209 of file scheduler/Classes/Task/AbstractTask.php.

References AbstractTask\$taskGroup.

setTaskUid (   $id)

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

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

Definition at line 112 of file scheduler/Classes/Task/AbstractTask.php.

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 504 of file scheduler/Classes/Task/AbstractTask.php.

unmarkAllExecutions ( )

Clears all marked executions

Returns
bool TRUE if the clearing succeeded, FALSE otherwise

Definition at line 479 of file scheduler/Classes/Task/AbstractTask.php.

References $GLOBALS.

unmarkExecution (   $executionID,
\Exception  $failure = null 
)

Removes given execution from list

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

Definition at line 428 of file scheduler/Classes/Task/AbstractTask.php.

References $GLOBALS.

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 262 of file scheduler/Classes/Task/AbstractTask.php.

Member Data Documentation

$description = ''
protected
$disabled = false
protected

Definition at line 43 of file scheduler/Classes/Task/AbstractTask.php.

Referenced by AbstractTask\isDisabled().

$execution
protected
$executionTime = 0
protected
$scheduler
protected

Definition at line 29 of file scheduler/Classes/Task/AbstractTask.php.

$taskGroup
protected
$taskUid
protected

Definition at line 36 of file scheduler/Classes/Task/AbstractTask.php.

Referenced by AbstractTask\getTaskUid().