TaskService
Service class helping to retrieve data for EXT:scheduler
This is not a public API method, do not use in own extensions
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Properties
Methods
- __construct() : mixed
- createNewTask() : AbstractTask
- getAdditionalFieldProviderForTask() : AdditionalFieldProviderInterface|null
- getAllTaskTypes() : array
- getCategorizedTaskTypes() : array
- getFieldsForRecord() : array
- Native fields are added / managed via FormEngine + dataHandler, so this only returns additional fields from the task object that are needed.
- getHumanReadableTaskName() : string
- getTaskDetailsFromTask() : array|null
- getTaskDetailsFromTaskType() : array|null
- getTaskTypesForTcaItems() : array
- Used in FormEngine. Actually, this is only needed to task types can be "validated" by form data providers.
- isTaskTypeRegistered() : bool
- prepareAdditionalFields() : array
- Prepared additional fields from field providers for rendering.
- setTaskDataFromRequest() : void
- getAvailableTaskTypes() : array
- This method fetches a list of all classes that have been registered with the Scheduler For each item the following information is provided, as an associative array:
- getTimestampFromDateString() : int
- Convert input to DateTime and retrieve timestamp.
Properties
$commandRegistry
protected
CommandRegistry
$commandRegistry
$tcaSchemaFactory
protected
TcaSchemaFactory
$tcaSchemaFactory
Methods
__construct()
public
__construct(CommandRegistry $commandRegistry, TcaSchemaFactory $tcaSchemaFactory) : mixed
Parameters
- $commandRegistry : CommandRegistry
- $tcaSchemaFactory : TcaSchemaFactory
createNewTask()
public
createNewTask(string $taskType) : AbstractTask
Parameters
- $taskType : string
Return values
AbstractTaskgetAdditionalFieldProviderForTask()
public
getAdditionalFieldProviderForTask(string $taskType) : AdditionalFieldProviderInterface|null
Parameters
- $taskType : string
Return values
AdditionalFieldProviderInterface|nullgetAllTaskTypes()
public
getAllTaskTypes([bool $includeNativeTypes = true ]) : array
Parameters
- $includeNativeTypes : bool = true
Return values
arraygetCategorizedTaskTypes()
public
getCategorizedTaskTypes() : array
Return values
arraygetFieldsForRecord()
Native fields are added / managed via FormEngine + dataHandler, so this only returns additional fields from the task object that are needed.
public
getFieldsForRecord(AbstractTask $task) : array
Parameters
- $task : AbstractTask
Return values
arraygetHumanReadableTaskName()
public
getHumanReadableTaskName(AbstractTask $task) : string
Parameters
- $task : AbstractTask
Return values
stringgetTaskDetailsFromTask()
public
getTaskDetailsFromTask(AbstractTask $taskObject) : array|null
Parameters
- $taskObject : AbstractTask
Return values
array|nullgetTaskDetailsFromTaskType()
public
getTaskDetailsFromTaskType(string $taskType) : array|null
Parameters
- $taskType : string
Return values
array|nullgetTaskTypesForTcaItems()
Used in FormEngine. Actually, this is only needed to task types can be "validated" by form data providers.
public
getTaskTypesForTcaItems(array &$config[, mixed $_ = null ][, bool $includeNativeItems = false ]) : array
There is no possibility to "select" a task type in FormEngine. The field is a readonly information.
Parameters
- $config : array
- $_ : mixed = null
- $includeNativeItems : bool = false
Return values
arrayisTaskTypeRegistered()
public
isTaskTypeRegistered(string $taskType) : bool
Parameters
- $taskType : string
Return values
boolprepareAdditionalFields()
Prepared additional fields from field providers for rendering.
public
prepareAdditionalFields(string $taskType, array $newAdditionalFields[, array $currentAdditionalFields = [] ]) : array
Parameters
- $taskType : string
- $newAdditionalFields : array
- $currentAdditionalFields : array = []
Return values
arraysetTaskDataFromRequest()
public
setTaskDataFromRequest(AbstractTask $task, array $incomingData) : void
Parameters
- $task : AbstractTask
- $incomingData : array
getAvailableTaskTypes()
This method fetches a list of all classes that have been registered with the Scheduler For each item the following information is provided, as an associative array:
protected
getAvailableTaskTypes([bool $includeNativeTypes = true ]) : array
['className'] => Name of the task PHP class ['extension'] => Key of the extension which provides the class ['filename'] => Path to the file containing the class ['title'] => String (possibly localized) containing a human-readable name for the class ['provider'] => Name of class that implements the interface for additional fields, if necessary
The name of the class itself is used as the key of the list array
Parameters
- $includeNativeTypes : bool = true
Return values
arraygetTimestampFromDateString()
Convert input to DateTime and retrieve timestamp.
protected
getTimestampFromDateString(int|string $input) : int
Parameters
- $input : int|string