You are here

class ExternalAuthRegisterEvent in External Authentication 2.0.x

Same name and namespace in other branches
  1. 8 src/Event/ExternalAuthRegisterEvent.php \Drupal\externalauth\Event\ExternalAuthRegisterEvent

Notify event listeners about an externalauth user registration.

Hierarchy

Expanded class hierarchy of ExternalAuthRegisterEvent

1 file declares its use of ExternalAuthRegisterEvent
ExternalAuth.php in src/ExternalAuth.php

File

src/Event/ExternalAuthRegisterEvent.php, line 11

Namespace

Drupal\externalauth\Event
View source
class ExternalAuthRegisterEvent extends Event {

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

  /**
   * The name of the service providing external authentication.
   *
   * @var string
   */
  protected $provider;

  /**
   * The unique, external authentication name.
   *
   * This is provided by the authentication provider.
   *
   * @var string
   */
  protected $authname;

  /**
   * Optional extra (serialized) data to store with the authname.
   *
   * @var mixed
   */
  protected $data;

  /**
   * Constructs an external registration event object.
   *
   * @param \Drupal\user\UserInterface $account
   *   The Drupal user account.
   * @param string $provider
   *   The name of the service providing external authentication.
   * @param string $authname
   *   The unique, external authentication name provided by authentication
   *   provider.
   * @param mixed $data
   *   Optional extra (serialized) data to store with the authname.
   */
  public function __construct(UserInterface $account, $provider, $authname, $data = NULL) {
    $this->account = $account;
    $this->provider = $provider;
    $this->authname = $authname;
    $this->data = $data;
  }

  /**
   * Gets the Drupal user entity.
   *
   * @return \Drupal\user\UserInterface
   *   The Drupal user account.
   */
  public function getAccount() {
    return $this->account;
  }

  /**
   * Gets the provider.
   *
   * @return string
   *   The name of the service providing external authentication.
   */
  public function getProvider() {
    return $this->provider;
  }

  /**
   * Gets the authname.
   *
   * @return string
   *   The unique, external authentication name provided by authentication
   *   provider.
   */
  public function getAuthname() {
    return $this->authname;
  }

  /**
   * Gets the data.
   *
   * @return mixed
   *   Optional extra (serialized) data to store with the authname.
   */
  public function getData() {
    return $this->data;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ExternalAuthRegisterEvent::$account protected property The Drupal user account.
ExternalAuthRegisterEvent::$authname protected property The unique, external authentication name.
ExternalAuthRegisterEvent::$data protected property Optional extra (serialized) data to store with the authname.
ExternalAuthRegisterEvent::$provider protected property The name of the service providing external authentication.
ExternalAuthRegisterEvent::getAccount public function Gets the Drupal user entity.
ExternalAuthRegisterEvent::getAuthname public function Gets the authname.
ExternalAuthRegisterEvent::getData public function Gets the data.
ExternalAuthRegisterEvent::getProvider public function Gets the provider.
ExternalAuthRegisterEvent::__construct public function Constructs an external registration event object.