You are here

class SocialAuthUserFieldsEvent in Social Auth 8

Defines the user fields event.

@todo validate user_fields to be set

Hierarchy

Expanded class hierarchy of SocialAuthUserFieldsEvent

See also

\Drupal\social_auth\Event\SocialAuthEvents

1 file declares its use of SocialAuthUserFieldsEvent
SocialAuthUserManager.php in src/SocialAuthUserManager.php

File

src/Event/SocialAuthUserFieldsEvent.php, line 14

Namespace

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

  /**
   * The user fields.
   *
   * @var array
   */
  protected $userFields;

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

  /**
   * Constructs a new SocialAuthUserFieldsEvent.
   *
   * @param array $user_fields
   *   Initial user fields to populate the newly created user.
   * @param string $plugin_id
   *   The plugin Id dispatching this event.
   */
  public function __construct(array $user_fields, $plugin_id) {
    $this->userFields = $user_fields;
    $this->pluginId = $plugin_id;
  }

  /**
   * Gets the user fields.
   *
   * @return array
   *   Fields to initialize for the user creation.
   */
  public function getUserFields() {
    return $this->userFields;
  }

  /**
   * Sets the user fields.
   *
   * @param array $user_fields
   *   The user fields.
   */
  public function setUserFields(array $user_fields) {
    $this->userFields = $user_fields;
  }

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

}

Members

Namesort descending Modifiers Type Description Overrides
SocialAuthUserFieldsEvent::$pluginId protected property The plugin id dispatching this event.
SocialAuthUserFieldsEvent::$userFields protected property The user fields.
SocialAuthUserFieldsEvent::getPluginId public function Gets the plugin id dispatching this event.
SocialAuthUserFieldsEvent::getUserFields public function Gets the user fields.
SocialAuthUserFieldsEvent::setUserFields public function Sets the user fields.
SocialAuthUserFieldsEvent::__construct public function Constructs a new SocialAuthUserFieldsEvent.