public function MessageWorker::processItem in Courier 8
Same name and namespace in other branches
- 2.x src/Plugin/QueueWorker/MessageWorker.php \Drupal\courier\Plugin\QueueWorker\MessageWorker::processItem()
Parameters
$data:
- integer $id: ID of a courier_message_queue_item entity.
Overrides QueueWorkerInterface::processItem
File
- src/
Plugin/ QueueWorker/ MessageWorker.php, line 30 - Contains \Drupal\courier\Plugin\QueueWorker\MessageWorker.
Class
- MessageWorker
- Triggers scheduled rules.
Namespace
Drupal\courier\Plugin\QueueWorkerCode
public function processItem($data) {
$message_queue = MessageQueueItem::load($data['id']);
if ($message_queue) {
/** @var \Drupal\courier\Service\MessageQueueManagerInterface $service */
$service = \Drupal::service('courier.manager.message_queue');
$service
->sendMessage($message_queue);
}
}