You are here

class UserEvent in Social Auth 8.2

Same name and namespace in other branches
  1. 3.x src/Event/UserEvent.php \Drupal\social_auth\Event\UserEvent

Dispatched when user is created or logged in through Social Auth.

Hierarchy

  • class \Drupal\social_auth\Event\UserEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of UserEvent

See also

\Drupal\social_auth\Event\SocialAuthEvents

2 files declare their use of UserEvent
UserAuthenticator.php in src/User/UserAuthenticator.php
UserManager.php in src/User/UserManager.php

File

src/Event/UserEvent.php, line 14

Namespace

Drupal\social_auth\Event
View source
class UserEvent extends Event {

  /**
   * The user.
   *
   * @var \Drupal\user\Entity\User
   */
  protected $user;

  /**
   * The plugin id dispatching this event.
   *
   * @var string
   */
  protected $pluginId;

  /**
   * The user's data passed by Social Auth.
   *
   * @var \Drupal\social_auth\User\SocialAuthUserInterface
   */
  protected $socialAuthUser;

  /**
   * UserEvent constructor.
   *
   * @param \Drupal\user\UserInterface $user
   *   The user.
   * @param string $plugin_id
   *   The plugin Id dispatching this event.
   * @param \Drupal\social_auth\User\SocialAuthUserInterface|null $social_auth_user
   *   The user's data passed by Social Auth.
   */
  public function __construct(UserInterface $user, $plugin_id, SocialAuthUserInterface $social_auth_user = NULL) {
    $this->user = $user;
    $this->pluginId = $plugin_id;
    $this->socialAuthUser = $social_auth_user;
  }

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

  /**
   * Gets the plugin id dispatching this event.
   *
   * @return string
   *   The plugin id.
   */
  public function getPluginId() {
    return $this->pluginId;
  }

  /**
   * Gets user's data passed by Social Auth.
   *
   * @return \Drupal\social_auth\User\SocialAuthUserInterface
   *   The user's data.
   */
  public function getSocialAuthUser() {
    return $this->socialAuthUser;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
UserEvent::$pluginId protected property The plugin id dispatching this event.
UserEvent::$socialAuthUser protected property The user's data passed by Social Auth.
UserEvent::$user protected property The user.
UserEvent::getPluginId public function Gets the plugin id dispatching this event.
UserEvent::getSocialAuthUser public function Gets user's data passed by Social Auth.
UserEvent::getUser public function Gets the user.
UserEvent::__construct public function UserEvent constructor.