‪TYPO3CMS  10.4
TYPO3\CMS\Scheduler\Example\SleepTaskAdditionalFieldProvider Class Reference
Inheritance diagram for TYPO3\CMS\Scheduler\Example\SleepTaskAdditionalFieldProvider:
TYPO3\CMS\Scheduler\AbstractAdditionalFieldProvider TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface

Public Member Functions

array getAdditionalFields (array &$taskInfo, $task, SchedulerModuleController $schedulerModule)
 
bool validateAdditionalFields (array &$submittedData, SchedulerModuleController $schedulerModule)
 
 saveAdditionalFields (array $submittedData, AbstractTask $task)
 

Protected Member Functions

LanguageService null getLanguageService ()
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Scheduler\AbstractAdditionalFieldProvider
 addMessage (string $message, int $severity=FlashMessage::OK)
 

Detailed Description

Additional fields provider class for usage with the Scheduler's sleep task

This class is an example is not considered part of the Public TYPO3 API.

Definition at line 29 of file SleepTaskAdditionalFieldProvider.php.

Member Function Documentation

◆ getAdditionalFields()

array TYPO3\CMS\Scheduler\Example\SleepTaskAdditionalFieldProvider::getAdditionalFields ( array &  $taskInfo,
  $task,
SchedulerModuleController  $schedulerModule 
)

This method is used to define new fields for adding or editing a task In this case, it adds a sleep time field

Parameters
array$taskInfo‪Reference to the array containing the info used in the add/edit form
SleepTask | null$task‪When editing, reference to the current task. NULL when adding.
SchedulerModuleController$schedulerModule‪Reference to the calling object (Scheduler's BE module)
Returns
‪array Array containing all the information pertaining to the additional fields

Implements TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface.

Definition at line 40 of file SleepTaskAdditionalFieldProvider.php.

References TYPO3\CMS\Scheduler\Task\Enumeration\Action\ADD, TYPO3\CMS\Scheduler\Task\Enumeration\Action\EDIT, and TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\getCurrentAction().

◆ getLanguageService()

LanguageService null TYPO3\CMS\Scheduler\Example\SleepTaskAdditionalFieldProvider::getLanguageService ( )
protected
Returns
‪LanguageService|null

Definition at line 105 of file SleepTaskAdditionalFieldProvider.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Scheduler\Example\SleepTaskAdditionalFieldProvider\validateAdditionalFields().

◆ saveAdditionalFields()

TYPO3\CMS\Scheduler\Example\SleepTaskAdditionalFieldProvider::saveAdditionalFields ( array  $submittedData,
AbstractTask  $task 
)

This method is used to save any additional input into the current task object if the task class matches

Parameters
array$submittedData‪Array containing the data submitted by the user
SleepTask$task‪Reference to the current task object

Implements TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface.

Definition at line 97 of file SleepTaskAdditionalFieldProvider.php.

◆ validateAdditionalFields()

bool TYPO3\CMS\Scheduler\Example\SleepTaskAdditionalFieldProvider::validateAdditionalFields ( array &  $submittedData,
SchedulerModuleController  $schedulerModule 
)

This method checks any additional data that is relevant to the specific task If the task class is not relevant, the method is expected to return TRUE

Parameters
array$submittedData‪Reference to the array containing the data submitted by the user
SchedulerModuleController$schedulerModule‪Reference to the calling object (Scheduler's BE module)
Returns
‪bool TRUE if validation was ok (or selected class is not relevant), FALSE otherwise

Implements TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface.

Definition at line 78 of file SleepTaskAdditionalFieldProvider.php.

References TYPO3\CMS\Scheduler\AbstractAdditionalFieldProvider\addMessage(), TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR, and TYPO3\CMS\Scheduler\Example\SleepTaskAdditionalFieldProvider\getLanguageService().