class QueueMessages in Mass Contact 8
Sends a mass contact message to a given user.
Plugin annotation
@QueueWorker(
id = "mass_contact_queue_messages",
title = @Translation("Queues a mass contact message for individual processing")
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Queue\QueueWorkerBase implements QueueWorkerInterface
- class \Drupal\mass_contact\Plugin\QueueWorker\QueueMessages implements ContainerFactoryPluginInterface
- class \Drupal\Core\Queue\QueueWorkerBase implements QueueWorkerInterface
Expanded class hierarchy of QueueMessages
See also
\Drupal\mass_contact\Plugin\QueueWorker\QueueMessages
File
- src/
Plugin/ QueueWorker/ QueueMessages.php, line 20
Namespace
Drupal\mass_contact\Plugin\QueueWorkerView source
class QueueMessages extends QueueWorkerBase implements ContainerFactoryPluginInterface {
/**
* The mass contact helper service.
*
* @var \Drupal\mass_contact\MassContactInterface
*/
protected $massContact;
/**
* Queue worker constructor.
*
* @param array $configuration
* The plugin configuration.
* @param string $plugin_id
* The plugin ID.
* @param mixed $plugin_definition
* The plugin definition.
* @param \Drupal\mass_contact\MassContactInterface $mass_contact
* The mass contact helper service.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, MassContactInterface $mass_contact) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->massContact = $mass_contact;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('mass_contact'));
}
/**
* {@inheritdoc}
*/
public function processItem($data) {
$this->massContact
->queueRecipients($data['message'], $data['configuration']);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
QueueMessages:: |
protected | property | The mass contact helper service. | |
QueueMessages:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
QueueMessages:: |
public | function |
Works on a single queue item. Overrides QueueWorkerInterface:: |
|
QueueMessages:: |
public | function |
Queue worker constructor. Overrides PluginBase:: |