MessageDigest.php in Message Digest 8
File
src/Plugin/QueueWorker/MessageDigest.php
View source
<?php
namespace Drupal\message_digest\Plugin\QueueWorker;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Queue\QueueWorkerBase;
use Drupal\message_digest\DigestManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
class MessageDigest extends QueueWorkerBase implements ContainerFactoryPluginInterface {
protected $digestManager;
public function __construct(array $configuration, $plugin_id, $plugin_definition, DigestManagerInterface $digest_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->digestManager = $digest_manager;
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('message_digest.manager'));
}
public function processItem($data) {
$this->digestManager
->processSingleUserDigest($data['uid'], $data['notifier_id'], $data['end_time']);
}
}
Classes
Name |
Description |
MessageDigest |
Queue worker to process sending of message subscriptions. |