You are here

class SamlauthUserLinkEvent in SAML Authentication 4.x

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

Wraps a samlauth user link event for event listeners.

Hierarchy

Expanded class hierarchy of SamlauthUserLinkEvent

3 files declare their use of SamlauthUserLinkEvent
SamlService.php in src/SamlService.php
TestSamlauthEventSubscriber.php in test_resources/samlauth_test/src/EventSubscriber/TestSamlauthEventSubscriber.php
UserFieldsEventSubscriber.php in modules/samlauth_user_fields/src/EventSubscriber/UserFieldsEventSubscriber.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|null
   *   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.