You are here

class UserEmailVerificationVerifyEvent in User email verification 8

Wraps a user email verification event for event subscribers.

Hierarchy

Expanded class hierarchy of UserEmailVerificationVerifyEvent

1 file declares its use of UserEmailVerificationVerifyEvent
UserEmailVerificationVerify.php in src/Controller/UserEmailVerificationVerify.php

File

src/Event/UserEmailVerificationVerifyEvent.php, line 13

Namespace

Drupal\user_email_verification\Event
View source
class UserEmailVerificationVerifyEvent extends Event {

  /**
   * The user account being verify.
   *
   * @var \Drupal\user\UserInterface
   */
  protected $user;

  /**
   * Notify the user as blocked account.
   *
   * @var \Drupal\user\UserInterface
   */
  protected $notifyAsBlocked;

  /**
   * Constructs a user email verification event object.
   *
   * @param \Drupal\user\UserInterface $user
   *   The user account being verify.
   * @param bool $notify_as_blocked
   *   Whether to notify the user as blocked account.
   */
  public function __construct(UserInterface $user, $notify_as_blocked = FALSE) {
    $this->user = $user;
    $this->notifyAsBlocked = $notify_as_blocked;
  }

  /**
   * Get the user account being verify.
   *
   * @return \Drupal\user\UserInterface
   *   The user account.
   */
  public function getUser() {
    return $this->user;
  }

  /**
   * Gets whether if the user must be notified as blocked account.
   *
   * @return bool
   *   The user account.
   */
  public function notifyAsBlocked() : bool {
    return $this->notifyAsBlocked;
  }

  /**
   * Sets whether if the user must be notified as blocked account.
   *
   * @param bool $notify_as_blocked
   *   Whether the user must be notified as blocked account.
   */
  public function setNotifyAsBlocked($notify_as_blocked) {
    $this->notifyAsBlocked = $notify_as_blocked;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
UserEmailVerificationVerifyEvent::$notifyAsBlocked protected property Notify the user as blocked account.
UserEmailVerificationVerifyEvent::$user protected property The user account being verify.
UserEmailVerificationVerifyEvent::getUser public function Get the user account being verify.
UserEmailVerificationVerifyEvent::notifyAsBlocked public function Gets whether if the user must be notified as blocked account.
UserEmailVerificationVerifyEvent::setNotifyAsBlocked public function Sets whether if the user must be notified as blocked account.
UserEmailVerificationVerifyEvent::__construct public function Constructs a user email verification event object.