‪TYPO3CMS  9.5
TYPO3\CMS\Scheduler\Example\TestTaskAdditionalFieldProvider Class Reference
Inheritance diagram for TYPO3\CMS\Scheduler\Example\TestTaskAdditionalFieldProvider:
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)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface
array getAdditionalFields (array &$taskInfo, $task, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule)
 
bool validateAdditionalFields (array &$submittedData, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule)
 
 saveAdditionalFields (array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task)
 

Additional Inherited Members

- ‪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 test task

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

Definition at line 27 of file TestTaskAdditionalFieldProvider.php.

Member Function Documentation

◆ getAdditionalFields()

array TYPO3\CMS\Scheduler\Example\TestTaskAdditionalFieldProvider::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 an email field

Parameters
array$taskInfo‪Reference to the array containing the info used in the add/edit form
AbstractTask | 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

Definition at line 38 of file TestTaskAdditionalFieldProvider.php.

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

◆ saveAdditionalFields()

TYPO3\CMS\Scheduler\Example\TestTaskAdditionalFieldProvider::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
\TYPO3\CMS\Scheduler\Task\AbstractTask$task‪Reference to the current task object

Definition at line 98 of file TestTaskAdditionalFieldProvider.php.

◆ validateAdditionalFields()

bool TYPO3\CMS\Scheduler\Example\TestTaskAdditionalFieldProvider::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

Definition at line 76 of file TestTaskAdditionalFieldProvider.php.

References $GLOBALS, TYPO3\CMS\Scheduler\AbstractAdditionalFieldProvider\addMessage(), and TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR.