You are here

class SamlauthUserLinkEvent in SAML Authentication 8.2

Same name and namespace in other branches
  1. 8.3 src/Event/SamlauthUserLinkEvent.php \Drupal\samlauth\Event\SamlauthUserLinkEvent
  2. 4.x src/Event/SamlauthUserLinkEvent.php \Drupal\samlauth\Event\SamlauthUserLinkEvent

Wraps a samlauth user sync event for event listeners.

Hierarchy

Expanded class hierarchy of SamlauthUserLinkEvent

1 file declares its use of SamlauthUserLinkEvent
SamlService.php in src/SamlService.php

File

src/Event/SamlauthUserLinkEvent.php, line 11

Namespace

Drupal\samlauth\Event
View source
class SamlauthUserLinkEvent extends Event {

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

  /**
   * The SAML attributes received from the IDP.
   *
   * Single values are typically represented as one-element arrays.
   *
   * @var array
   */
  protected $attributes;

  /**
   * Constructs a samlouth user link event object.
   *
   * @param array $attributes
   *   The SAML attributes received from the IDP.
   */
  public function __construct(array $attributes) {
    $this->attributes = $attributes;
  }

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

  /**
   * Sets the Drupal user account to link.
   *
   * @param \Drupal\user\UserInterface $account
   *   The Drupal user account.
   */
  public function setLinkedAccount(UserInterface $account) {
    $this->account = $account;
  }

  /**
   * Gets the SAML attributes.
   *
   * @return array
   *   The SAML attributes received from the IDP.
   */
  public function getAttributes() {
    return $this->attributes;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SamlauthUserLinkEvent::$account protected property The Drupal user account to link.
SamlauthUserLinkEvent::$attributes protected property The SAML attributes received from the IDP.
SamlauthUserLinkEvent::getAttributes public function Gets the SAML attributes.
SamlauthUserLinkEvent::getLinkedAccount public function Gets the Drupal user account to link.
SamlauthUserLinkEvent::setLinkedAccount public function Sets the Drupal user account to link.
SamlauthUserLinkEvent::__construct public function Constructs a samlouth user link event object.