Entity Enqueue
Component ID
2480435
Component name
Entity Enqueue
Component type
module
Maintenance status
Development status
Component security advisory coverage
covered
Downloads
899
Component created
Component changed
Component body
Entity Enqueue provides utility functions to enqueue entities to be processed later using Drupal's Queue API. It will not process any entity enqueued, you have to write the corresponding queue worker callback as always according the Queue API.
In addition to saving a few lines of code on Queue API calls each time you create a queue item, the most useful part comes from the provided matching Drush commands for each possible function.
Example
Code
$data = array(
'custom_queue_data_field' => 'foobar',
);
entity_enqueue_entity('nodes_to_export', 1234, 'node', $data);
Drush command
$ drush entity-enqueue nodes_to_export 1234 --type=node --data="{custom_queue_data_field:'foobar'}"
The enqueued item data payload that your worker callback will get is:
$data = array(
'entity_id' => 1234,
'entity_type' => 'node',
'custom_queue_data_field' => 'foobar',
);
Ideas & ToDo
- Document functions/provide docblocks.
- Functions to enqueue a fully loaded object
- entity_enqueue_multiple functions
- Enqueue entities resulting from an EntityFieldQuery
- Services integration
- Actions integration
- Views Bulk Operations integration
