Documentation

CRM_Queue_Task
in package

A task is an item that can be enqueued and later executed

Table of Contents

Constants

TASK_FAIL  = 2
Task failed and should not be retried.
TASK_SUCCESS  = 1
Task was performed successfully.

Properties

$arguments  : array<string|int, mixed>
$callback  : mixed
$runAs  : array<string|int, mixed>|null
$title  : string|null

Methods

__construct()  : mixed
run()  : bool
Perform the task.
getSummary()  : string

Constants

TASK_FAIL

Task failed and should not be retried.

public mixed TASK_FAIL = 2

TASK_SUCCESS

Task was performed successfully.

public mixed TASK_SUCCESS = 1

Properties

$arguments

public array<string|int, mixed> $arguments

serializable

$callback

public mixed $callback

serializable

$runAs

public array<string|int, mixed>|null $runAs

serializable

If specified, it may include these keys:

  • contactId: int|null
  • domainId: int|null

$title

public string|null $title

Methods

__construct()

public __construct(mixed $callback[, array<string|int, mixed> $arguments = [] ][, string|null $title = NULL ]) : mixed
Parameters
$callback : mixed

Serializable, a callable PHP item; must accept at least one argument (CRM_Queue_TaskContext).

$arguments : array<string|int, mixed> = []

Serializable, extra arguments to pass to the callback (in order).

$title : string|null = NULL

A printable string which describes this task.

run()

Perform the task.

public run(CRM_Queue_TaskContext $taskCtx) : bool
Parameters
$taskCtx : CRM_Queue_TaskContext
Tags
throws
Exception
Return values
bool

TRUE if task completes successfully. FALSE or exception if task fails.

getSummary()

private getSummary() : string
Return values
string

        
On this page

Search results