class UserEmailVerificationDeleteAccount in User email verification 8
Delete user accounts which wasn't verified by cron.
Plugin annotation
@QueueWorker(
id = "user_email_verification_delete_account",
title = @Translation("User email verification: Delete 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\UserEmailVerificationDeleteAccount implements ContainerFactoryPluginInterface
- class \Drupal\Core\Queue\QueueWorkerBase implements QueueWorkerInterface
Expanded class hierarchy of UserEmailVerificationDeleteAccount
File
- src/
Plugin/ QueueWorker/ UserEmailVerificationDeleteAccount.php, line 20
Namespace
Drupal\user_email_verification\Plugin\QueueWorkerView source
class UserEmailVerificationDeleteAccount 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
->deleteUserAccountById($uid);
}
$this->logger
->notice('Deleted 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. | |
UserEmailVerificationDeleteAccount:: |
protected | property | A logger instance. | |
UserEmailVerificationDeleteAccount:: |
protected | property | User email verification helper service. | |
UserEmailVerificationDeleteAccount:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
UserEmailVerificationDeleteAccount:: |
public | function |
Works on a single queue item. Overrides QueueWorkerInterface:: |
|
UserEmailVerificationDeleteAccount:: |
public | function |
Constructs a new object. Overrides PluginBase:: |