class UserEmailVerificationBlockAccount in User email verification 8
Block user accounts which wasn't verified by cron.
Plugin annotation
@QueueWorker(
id = "user_email_verification_block_account",
title = @Translation("User email verification: Block user accounts"),
cron = {"time" = 30}
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Queue\QueueWorkerBase implements QueueWorkerInterface
- class \Drupal\user_email_verification\Plugin\QueueWorker\UserEmailVerificationBlockAccount implements ContainerFactoryPluginInterface
- class \Drupal\Core\Queue\QueueWorkerBase implements QueueWorkerInterface
Expanded class hierarchy of UserEmailVerificationBlockAccount
File
- src/
Plugin/ QueueWorker/ UserEmailVerificationBlockAccount.php, line 20
Namespace
Drupal\user_email_verification\Plugin\QueueWorkerView source
class UserEmailVerificationBlockAccount extends QueueWorkerBase implements ContainerFactoryPluginInterface {
/**
* User email verification helper service.
*
* @var \Drupal\user_email_verification\UserEmailVerificationInterface
*/
protected $userEmailVerification;
/**
* A logger instance.
*
* @var \Psr\Log\LoggerInterface
*/
protected $logger;
/**
* Constructs a new object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\user_email_verification\UserEmailVerificationInterface $user_email_verification_service
* User email verification helper service.
* @param \Psr\Log\LoggerInterface $logger
* A logger instance.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, UserEmailVerificationInterface $user_email_verification_service, LoggerInterface $logger) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->userEmailVerification = $user_email_verification_service;
$this->logger = $logger;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('user_email_verification.service'), $container
->get('logger.factory')
->get('user_email_verification'));
}
/**
* {@inheritdoc}
*/
public function processItem($data) {
foreach ($data as $uid) {
$this->userEmailVerification
->blockUserAccountById($uid);
}
$this->logger
->notice('Blocked users with IDs: %ids', [
'%ids' => implode(', ', $data),
]);
}
}
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. | |
UserEmailVerificationBlockAccount:: |
protected | property | A logger instance. | |
UserEmailVerificationBlockAccount:: |
protected | property | User email verification helper service. | |
UserEmailVerificationBlockAccount:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
UserEmailVerificationBlockAccount:: |
public | function |
Works on a single queue item. Overrides QueueWorkerInterface:: |
|
UserEmailVerificationBlockAccount:: |
public | function |
Constructs a new object. Overrides PluginBase:: |