‪TYPO3CMS  9.5
TYPO3\CMS\Core\Resource\Processing\TaskInterface Interface Reference
Inheritance diagram for TYPO3\CMS\Core\Resource\Processing\TaskInterface:
TYPO3\CMS\Core\Resource\Processing\AbstractTask TYPO3\CMS\Core\Resource\Processing\AbstractGraphicalTask TYPO3\CMS\Core\Resource\Processing\ImageCropScaleMaskTask TYPO3\CMS\Core\Resource\Processing\ImagePreviewTask

Public Member Functions

 __construct (Resource\ProcessedFile $targetFile, array $configuration)
 
string getName ()
 
string getType ()
 
Resource ProcessedFile getTargetFile ()
 
Resource File getSourceFile ()
 
array getConfiguration ()
 
string getConfigurationChecksum ()
 
string getTargetFileName ()
 
string getTargetFileExtension ()
 
bool fileNeedsProcessing ()
 
bool isExecuted ()
 
 setExecuted ($successful)
 
bool isSuccessful ()
 

Detailed Description

A task is a unit of work that can be performed by a file processor. This may include multiple steps in any order, details depend on the configuration of the task and the tools the processor uses.

Each task has a type and a name. The type describes the category of the task, like "image" and "video". If your task is generic or applies to multiple types of files, use "general".

A task also already has to know the target file it should be executed on, so there is no "abstract" task that just specifies the steps to be executed without a concrete file. However, new tasks can easily be created from an existing task object.

Definition at line 30 of file TaskInterface.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Resource\Processing\TaskInterface::__construct ( Resource\ProcessedFile  $targetFile,
array  $configuration 
)
Parameters
\TYPO3\CMS\Core\Resource\ProcessedFile$targetFile
array$configuration

Implemented in TYPO3\CMS\Core\Resource\Processing\AbstractTask.

Member Function Documentation

◆ fileNeedsProcessing()

bool TYPO3\CMS\Core\Resource\Processing\TaskInterface::fileNeedsProcessing ( )

Returns TRUE if the file has to be processed at all, such as e.g. the original file does.

Note: This does not indicate if the concrete ProcessedFile attached to this task has to be (re)processed. This check is done in ProcessedFile::isOutdated().

Todo:
‪isOutdated()/needsReprocessing()?
Returns
‪bool

Implemented in TYPO3\CMS\Core\Resource\Processing\ImagePreviewTask, and TYPO3\CMS\Core\Resource\Processing\ImageCropScaleMaskTask.

◆ getConfiguration()

array TYPO3\CMS\Core\Resource\Processing\TaskInterface::getConfiguration ( )

Returns the configuration for this task.

Returns
‪array

Implemented in TYPO3\CMS\Core\Resource\Processing\AbstractTask.

Referenced by TYPO3\CMS\Core\Resource\Processing\LocalPreviewHelper\process().

◆ getConfigurationChecksum()

string TYPO3\CMS\Core\Resource\Processing\TaskInterface::getConfigurationChecksum ( )

◆ getName()

string TYPO3\CMS\Core\Resource\Processing\TaskInterface::getName ( )

◆ getSourceFile()

◆ getTargetFile()

◆ getTargetFileExtension()

string TYPO3\CMS\Core\Resource\Processing\TaskInterface::getTargetFileExtension ( )

◆ getTargetFileName()

string TYPO3\CMS\Core\Resource\Processing\TaskInterface::getTargetFileName ( )

◆ getType()

string TYPO3\CMS\Core\Resource\Processing\TaskInterface::getType ( )

◆ isExecuted()

bool TYPO3\CMS\Core\Resource\Processing\TaskInterface::isExecuted ( )

Returns TRUE if this task has been executed, no matter if the execution was successful.

Returns
‪bool

Implemented in TYPO3\CMS\Core\Resource\Processing\AbstractTask.

◆ isSuccessful()

bool TYPO3\CMS\Core\Resource\Processing\TaskInterface::isSuccessful ( )

Returns TRUE if this task has been successfully executed. Only call this method if the task has been processed at all.

Returns
‪bool
Exceptions

Implemented in TYPO3\CMS\Core\Resource\Processing\AbstractTask.

◆ setExecuted()

TYPO3\CMS\Core\Resource\Processing\TaskInterface::setExecuted (   $successful)

Mark this task as executed. This is used by the Processors in order to transfer the state of this task to the file processing service.

Parameters
bool$successful‪Set this to FALSE if executing the task failed

Implemented in TYPO3\CMS\Core\Resource\Processing\AbstractTask.

Referenced by TYPO3\CMS\Core\Resource\Processing\LocalImageProcessor\checkForExistingTargetFile(), and TYPO3\CMS\Core\Resource\Processing\LocalImageProcessor\processTask().