SchedulerTaskRepository

Read onlyYes

Repository class to fetch tasks available in the systems ready to be executed

Attributes
#[Autoconfigure]
$public: true

Table of Contents

Constants

TABLE_NAME  = 'tx_scheduler_task'

Properties

$taskSerializer  : TaskSerializer
$taskService  : TaskService
$tcaSchemaFactory  : TcaSchemaFactory

Methods

__construct()  : mixed
addExecutionToTask()  : int
This method adds current execution to the execution list.
findByUid()  : AbstractTask
Fetches a task object from the db with the given $uid. The object representing the next due task is returned.
findNextExecutableTask()  : AbstractTask|null
Fetch and unserialize a task object from the db. Returns the object representing the next due task is returned. If there are no due tasks, the method throws an exception.
findNextExecutableTaskForUid()  : AbstractTask|null
Fetch and unserialize task objects selected with some (SQL) condition
getGroupedTasks()  : array<string|int, mixed>
hasTasks()  : bool
See if there are any tasks configured at all.
isTaskMarkedAsRunning()  : bool
remove()  : bool
Removes a task completely from the system.
removeAllRegisteredExecutionsForTask()  : bool
Clears all marked executions
removeExecutionOfTask()  : void
Removes a given execution from the list
update()  : bool
Update a task in the pool.
updateExecution()  : void
Update a task in the pool but only the execution information.
createValidTaskObjectOrDisableTask()  : AbstractTask
isValidTaskObject()  : bool

Constants

TABLE_NAME

protected mixed TABLE_NAME = 'tx_scheduler_task'

Properties

Methods

addExecutionToTask()

This method adds current execution to the execution list.

public addExecutionToTask(AbstractTask $task) : int

It also logs the execution time and mode

The execution id is guaranteed to start from zero if the task has no currently running execution at the time of id allocation.

Parameters
$task : AbstractTask
Return values
int

Execution id

findByUid()

Fetches a task object from the db with the given $uid. The object representing the next due task is returned.

public findByUid(int $uid) : AbstractTask

If there are no due tasks the method throws an exception.

Parameters
$uid : int

Primary key of a task

Tags
throws
OutOfBoundsException
throws
UnexpectedValueException
Return values
AbstractTask

findNextExecutableTask()

Fetch and unserialize a task object from the db. Returns the object representing the next due task is returned. If there are no due tasks, the method throws an exception.

public findNextExecutableTask() : AbstractTask|null
Tags
throws
UnexpectedValueException
Return values
AbstractTask|null

The fetched task object

findNextExecutableTaskForUid()

Fetch and unserialize task objects selected with some (SQL) condition

public findNextExecutableTaskForUid(int $uid) : AbstractTask|null
Parameters
$uid : int
Return values
AbstractTask|null

getGroupedTasks()

public getGroupedTasks() : array<string|int, mixed>
Internal

This will get split up into errored classes

Return values
array<string|int, mixed>

hasTasks()

See if there are any tasks configured at all.

public hasTasks() : bool
Return values
bool

remove()

Removes a task completely from the system.

public remove(int|AbstractTask $task) : bool
Parameters
$task : int|AbstractTask

The object representing the task to delete

Return values
bool

TRUE if the task was successfully deleted, FALSE otherwise

removeAllRegisteredExecutionsForTask()

Clears all marked executions

public removeAllRegisteredExecutionsForTask(AbstractTask $task) : bool
Parameters
$task : AbstractTask
Return values
bool

TRUE if the clearing succeeded, FALSE otherwise

removeExecutionOfTask()

Removes a given execution from the list

public removeExecutionOfTask(AbstractTask $task, int $executionID[, string|array<string|int, mixed>|null $failureReason = null ]) : void
Parameters
$task : AbstractTask
$executionID : int

Id of the execution to remove.

$failureReason : string|array<string|int, mixed>|null = null

Details of an exception to signal a failed execution.

update()

Update a task in the pool.

public update(AbstractTask $task[, array<string|int, mixed>|null $fields = null ]) : bool
Parameters
$task : AbstractTask
$fields : array<string|int, mixed>|null = null
Return values
bool

updateExecution()

Update a task in the pool but only the execution information.

public updateExecution(AbstractTask $task[, bool $forceDisablingTask = false ]) : void
Parameters
$task : AbstractTask
$forceDisablingTask : bool = false

createValidTaskObjectOrDisableTask()

protected createValidTaskObjectOrDisableTask(array<string|int, mixed> $row) : AbstractTask
Parameters
$row : array<string|int, mixed>
Return values
AbstractTask

isValidTaskObject()

protected isValidTaskObject(mixed $task) : bool
Parameters
$task : mixed
Return values
bool

        
On this page

Search results