You are here

class ExternalAuthAuthmapAlterEvent in External Authentication 8

Same name and namespace in other branches
  1. 2.0.x src/Event/ExternalAuthAuthmapAlterEvent.php \Drupal\externalauth\Event\ExternalAuthAuthmapAlterEvent

Allow event listeners to alter the authmap data that will get stored.

Hierarchy

Expanded class hierarchy of ExternalAuthAuthmapAlterEvent

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

File

src/Event/ExternalAuthAuthmapAlterEvent.php, line 10

Namespace

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

  /**
   * 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;

  /**
   * The username to generate when registering this user.
   *
   * @var string
   */
  protected $username;

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

  /**
   * Constructs a authmap alter event object.
   *
   * @param string $provider
   *   The name of the service providing external authentication.
   * @param string $authname
   *   The unique, external authentication name provided by authentication
   *   provider.
   * @param string $username
   *   The username to generate when registering this user.
   * @param mixed $data
   *   Optional extra (serialized) data to store with the authname.
   */
  public function __construct($provider, $authname, $username, $data = NULL) {
    $this->provider = $provider;
    $this->authname = $authname;
    $this->username = $username;
    $this->data = $data;
  }

  /**
   * 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;
  }

  /**
   * Sets the authname.
   *
   * @param string $authname
   *   The unique, external authentication name provided by authentication
   *   provider.
   */
  public function setAuthname($authname) {
    $this->authname = $authname;
  }

  /**
   * Gets the username.
   *
   * @return string
   *   The username to generate when registering this user.
   */
  public function getUsername() {
    return $this->username;
  }

  /**
   * Sets the username.
   *
   * @param string $username
   *   The username to generate when registering this user.
   */
  public function setUsername($username) {
    $this->username = $username;
  }

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

  /**
   * Sets the data.
   *
   * @param mixed $data
   *   Optional extra (serialized) data to store with the authname.
   */
  public function setData($data) {
    $this->data = $data;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ExternalAuthAuthmapAlterEvent::$authname protected property The unique, external authentication name.
ExternalAuthAuthmapAlterEvent::$data protected property Optional extra (serialized) data to store with the authname.
ExternalAuthAuthmapAlterEvent::$provider protected property The name of the service providing external authentication.
ExternalAuthAuthmapAlterEvent::$username protected property The username to generate when registering this user.
ExternalAuthAuthmapAlterEvent::getAuthname public function Gets the authname.
ExternalAuthAuthmapAlterEvent::getData public function Gets the data.
ExternalAuthAuthmapAlterEvent::getProvider public function Gets the provider.
ExternalAuthAuthmapAlterEvent::getUsername public function Gets the username.
ExternalAuthAuthmapAlterEvent::setAuthname public function Sets the authname.
ExternalAuthAuthmapAlterEvent::setData public function Sets the data.
ExternalAuthAuthmapAlterEvent::setUsername public function Sets the username.
ExternalAuthAuthmapAlterEvent::__construct public function Constructs a authmap alter event object.