AdditionalFieldProviderInterface

Interface for classes who want to provide additional fields when adding a task

Table of Contents

Methods

getAdditionalFields()  : array
Gets additional fields to render in the form to add/edit a task
saveAdditionalFields()  : mixed
Takes care of saving the additional fields' values in the task's object
validateAdditionalFields()  : bool
Validates the additional fields' values

Methods

getAdditionalFields()

Gets additional fields to render in the form to add/edit a task

public getAdditionalFields(array &$taskInfo, AbstractTask|null $task, SchedulerModuleController $schedulerModule) : array
Parameters
$taskInfo : array

Values of the fields from the add/edit task form

$task : AbstractTask|null

The task object being edited. Null when adding a task!

$schedulerModule : SchedulerModuleController

Reference to the scheduler backend module

Return values
array —

A two dimensional array: array('fieldId' => array('code' => '', 'label' => '', 'cshKey' => '', 'cshLabel' => ''))

saveAdditionalFields()

Takes care of saving the additional fields' values in the task's object

public saveAdditionalFields(array $submittedData, AbstractTask $task) : mixed
Parameters
$submittedData : array

An array containing the data submitted by the add/edit task form

$task : AbstractTask

Reference to the scheduler backend module

validateAdditionalFields()

Validates the additional fields' values

public validateAdditionalFields(array &$submittedData, SchedulerModuleController $schedulerModule) : bool
Parameters
$submittedData : array

An array containing the data submitted by the add/edit task form

$schedulerModule : SchedulerModuleController

Reference to the scheduler backend module

Return values
bool —

TRUE if validation was ok (or selected class is not relevant), FALSE otherwise

On this page

Search results