You are here

class UserEmailVerificationReminders in User email verification 8

Remind users which wasn't verified by cron.

Plugin annotation


@QueueWorker(
  id = "user_email_verification_reminders",
  title = @Translation("User email verification: Remind users"),
  cron = {"time" = 30}
)

Hierarchy

Expanded class hierarchy of UserEmailVerificationReminders

File

src/Plugin/QueueWorker/UserEmailVerificationReminders.php, line 19

Namespace

Drupal\user_email_verification\Plugin\QueueWorker
View source
class UserEmailVerificationReminders extends QueueWorkerBase implements ContainerFactoryPluginInterface {

  /**
   * User email verification helper service.
   *
   * @var \Drupal\user_email_verification\UserEmailVerificationInterface
   */
  protected $userEmailVerification;

  /**
   * 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.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, UserEmailVerificationInterface $user_email_verification_service) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->userEmailVerification = $user_email_verification_service;
  }

  /**
   * {@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'));
  }

  /**
   * {@inheritdoc}
   */
  public function processItem($data) {
    foreach ($data as $uid) {
      $this->userEmailVerification
        ->remindUserById($uid);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
UserEmailVerificationReminders::$userEmailVerification protected property User email verification helper service.
UserEmailVerificationReminders::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create
UserEmailVerificationReminders::processItem public function Works on a single queue item. Overrides QueueWorkerInterface::processItem
UserEmailVerificationReminders::__construct public function Constructs a new object. Overrides PluginBase::__construct