CRM_Extension_Upgrader_QueueTrait
The QueueTrait provides helper methods for adding new tasks to a queue.
Table of Contents
Properties
Methods
- _queueAdapter() : mixed
- Adapter that lets you add normal (non-static) member functions to the queue.
- addTask() : mixed
- getExtensionKey() : mixed
- getQueue() : CRM_Queue_Queue
- prependTask() : mixed
- Enqueue a task based on a method in this class.
- setQueue() : void
- appendTask() : mixed
- Enqueue a task based on a method in this class.
Properties
$ctx
protected
CRM_Queue_TaskContext
$ctx
$queue
protected
CRM_Queue_Queue
$queue
Methods
_queueAdapter()
Adapter that lets you add normal (non-static) member functions to the queue.
public
static _queueAdapter(CRM_Queue_TaskContext $ctx, string $extensionKey, string $method, mixed ...$args) : mixed
While working through a task-queue, the _queueAdapter is called statically. It looks up the appropriate object and invokes the expected method.
CRM_Extension_Upgrader::_queueAdapter($ctx, 'org.example.myext', 'methodName', 'arg1', 'arg2');
Parameters
- $ctx : CRM_Queue_TaskContext
- $extensionKey : string
- $method : string
- $args : mixed
addTask()
public
addTask(string $title, string $funcName, mixed ...$options) : mixed
Parameters
- $title : string
- $funcName : string
- $options : mixed
getExtensionKey()
public
abstract getExtensionKey() : mixed
getQueue()
public
getQueue() : CRM_Queue_Queue
Return values
CRM_Queue_QueueprependTask()
Enqueue a task based on a method in this class.
public
prependTask(string $title, string $funcName, mixed ...$options) : mixed
The task is weighted so that it is processed as part of the currently-pending revision.
After passing the $funcName, you can also pass parameters that will go to the function. Note that all params must be serializable.
Parameters
- $title : string
- $funcName : string
- $options : mixed
setQueue()
public
setQueue(CRM_Queue_Queue $queue) : void
Parameters
- $queue : CRM_Queue_Queue
appendTask()
Enqueue a task based on a method in this class.
protected
appendTask(string $title, string $funcName, mixed ...$options) : mixed
The task has a default weight.
Parameters
- $title : string
- $funcName : string
- $options : mixed