You are here

class Mapping in Lightweight Directory Access Protocol (LDAP) 8.4

Interface for the synchronization mappings ldap_user provides.

Hierarchy

  • class \Drupal\ldap_servers\Mapping

Expanded class hierarchy of Mapping

4 files declare their use of Mapping
FieldProvider.php in ldap_user/src/FieldProvider.php
LdapUserMappingBaseForm.php in ldap_user/src/Form/LdapUserMappingBaseForm.php
LdapUserMappingToDrupalForm.php in ldap_user/src/Form/LdapUserMappingToDrupalForm.php
LdapUserMappingToLdapForm.php in ldap_user/src/Form/LdapUserMappingToLdapForm.php

File

ldap_servers/src/Mapping.php, line 10

Namespace

Drupal\ldap_servers
View source
class Mapping {

  /**
   * ID.
   *
   * @var string
   */
  private $id;

  /**
   * Label.
   *
   * @var string
   */
  private $label;

  /**
   * Configurable.
   *
   * @var bool
   */
  private $configurable;

  /**
   * Binary.
   *
   * @var bool
   */
  private $binary = FALSE;

  /**
   * Notes.
   *
   * @var string
   */
  private $notes;

  /**
   * Enabled.
   *
   * @var bool
   */
  private $enabled;

  /**
   * Provisioning events.
   *
   * @var array
   */
  private $provisioningEvents;

  /**
   * Configuration module.
   *
   * @var string
   */
  private $configurationModule;

  /**
   * Provisioning module.
   *
   * @var string
   */
  private $provisioningModule;

  /**
   * LDAP attribute.
   *
   * @var string
   */
  private $ldapAttribute = '';

  /**
   * Drupal attribute.
   *
   * @var string
   */
  private $drupalAttribute = '';

  /**
   * User tokens.
   *
   * @var string
   */
  private $userTokens = '';

  /**
   * Mapping constructor.
   *
   * @param string $id
   *   ID.
   * @param string $label
   *   Label.
   * @param bool $configurable
   *   Configurable.
   * @param bool $enabled
   *   Enabled.
   * @param array $provisioning_events
   *   Provisioning events.
   * @param string $configuration_module
   *   Configuration module.
   * @param string $provisioning_module
   *   Provisioning module.
   */
  public function __construct(string $id, string $label = '', bool $configurable = FALSE, bool $enabled = FALSE, array $provisioning_events = [], string $configuration_module = '', string $provisioning_module = '') {
    $this->id = $id;
    $this->label = $label;
    $this->configurable = $configurable;
    $this->enabled = $enabled;
    $this->provisioningEvents = $provisioning_events;
    $this->configurationModule = $configuration_module;
    $this->provisioningModule = $provisioning_module;
  }

  /**
   * Serialized data.
   *
   * @return array
   *   Data.
   */
  public function serialize() : array {
    return [
      'ldap_attr' => $this
        ->getLdapAttribute(),
      'user_attr' => $this
        ->getDrupalAttribute(),
      'convert' => $this
        ->isBinary(),
      'user_tokens' => $this
        ->getUserTokens(),
      'config_module' => $this
        ->getConfigurationModule(),
      'prov_module' => $this
        ->getProvisioningModule(),
      'prov_events' => $this
        ->getProvisioningEvents(),
    ];
  }

  /**
   * Get label.
   *
   * @return null|string
   *   Label.
   */
  public function getLabel() : ?string {
    return $this->label;
  }

  /**
   * Set label.
   *
   * @param string $label
   *   Label.
   */
  public function setLabel(string $label) : void {
    $this->label = $label;
  }

  /**
   * Is configurable.
   *
   * @return bool
   *   Configurable.
   */
  public function isConfigurable() : bool {
    return $this->configurable;
  }

  /**
   * Get notes.
   *
   * @return null|string
   *   Notes.
   */
  public function getNotes() : ?string {
    return $this->notes;
  }

  /**
   * Set Notes.
   *
   * @param string $notes
   *   Notes.
   */
  public function setNotes(string $notes) : void {
    $this->notes = $notes;
  }

  /**
   * Is enabled.
   *
   * @return bool
   *   Enabled.
   */
  public function isEnabled() : bool {
    return $this->enabled;
  }

  /**
   * Set enabled.
   *
   * @param bool $enabled
   *   Enabled.
   */
  public function setEnabled(bool $enabled) : void {
    $this->enabled = $enabled;
  }

  /**
   * Get provisioning events.
   *
   * @return array
   *   Events.
   */
  public function getProvisioningEvents() : array {
    return $this->provisioningEvents;
  }

  /**
   * Provisioning event available?
   *
   * @param string $event
   *   Event.
   *
   * @return bool
   *   Available.
   */
  public function hasProvisioningEvent(string $event) : bool {
    return in_array($event, $this->provisioningEvents, TRUE);
  }

  /**
   * Set provisioning events.
   *
   * @param array $events
   *   Provisioning vents.
   */
  public function setProvisioningEvents(array $events) : void {
    $this->provisioningEvents = $events;
  }

  /**
   * Get configuration module.
   *
   * @return string
   *   Module.
   */
  public function getConfigurationModule() : string {
    return $this->configurationModule;
  }

  /**
   * Set configuration module.
   *
   * @param string $configurationModule
   *   Module.
   */
  public function setConfigurationModule(string $configurationModule) : void {
    $this->configurationModule = $configurationModule;
  }

  /**
   * Get provisioning module.
   *
   * @return string
   *   Module.
   */
  public function getProvisioningModule() : string {
    return $this->provisioningModule;
  }

  /**
   * Set provisioning module.
   *
   * @param string $provisioningModule
   *   Module.
   */
  public function setProvisioningModule(string $provisioningModule) : void {
    $this->provisioningModule = $provisioningModule;
  }

  /**
   * Get LDAP attribute.
   *
   * @return string
   *   LDAP attribute.
   */
  public function getLdapAttribute() : string {
    return $this->ldapAttribute;
  }

  /**
   * Set LDAP attribute.
   *
   * @param string $ldapAttribute
   *   LDAP attribute.
   */
  public function setLdapAttribute(string $ldapAttribute) : void {
    $this->ldapAttribute = $ldapAttribute;
  }

  /**
   * Get Drupal attribute.
   *
   * @return string
   *   Drupal attribute.
   */
  public function getDrupalAttribute() : string {
    return $this->drupalAttribute;
  }

  /**
   * Set Drupal attribute.
   *
   * @param string $drupalAttribute
   *   Drupal attribute.
   */
  public function setDrupalAttribute(string $drupalAttribute) : void {
    $this->drupalAttribute = $drupalAttribute;
  }

  /**
   * Get ID.
   *
   * @return string
   *   ID.
   */
  public function getId() : string {
    return $this->id;
  }

  /**
   * Get user tokens.
   *
   * @return string
   *   Tokens.
   */
  public function getUserTokens() : string {
    return $this->userTokens;
  }

  /**
   * Set user tokens.
   *
   * @param string $userTokens
   *   Token.
   */
  public function setUserTokens(string $userTokens) : void {
    $this->userTokens = $userTokens;
  }

  /**
   * Mapping is binary.
   *
   * @return bool
   *   Binary.
   */
  public function isBinary() : bool {
    return $this->binary;
  }

  /**
   * Mapping set is binary.
   *
   * @todo improve syntax.
   *
   * @param bool $binary
   *   Is binary.
   */
  public function convertBinary(bool $binary) : void {
    $this->binary = $binary;
  }

  /**
   * Mapping set is configurable.
   *
   * @todo improve syntax.
   *
   * @param bool $configurable
   *   Is configurable.
   */
  public function setConfigurable(bool $configurable) : void {
    $this->configurable = $configurable;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Mapping::$binary private property Binary.
Mapping::$configurable private property Configurable.
Mapping::$configurationModule private property Configuration module.
Mapping::$drupalAttribute private property Drupal attribute.
Mapping::$enabled private property Enabled.
Mapping::$id private property ID.
Mapping::$label private property Label.
Mapping::$ldapAttribute private property LDAP attribute.
Mapping::$notes private property Notes.
Mapping::$provisioningEvents private property Provisioning events.
Mapping::$provisioningModule private property Provisioning module.
Mapping::$userTokens private property User tokens.
Mapping::convertBinary public function Mapping set is binary.
Mapping::getConfigurationModule public function Get configuration module.
Mapping::getDrupalAttribute public function Get Drupal attribute.
Mapping::getId public function Get ID.
Mapping::getLabel public function Get label.
Mapping::getLdapAttribute public function Get LDAP attribute.
Mapping::getNotes public function Get notes.
Mapping::getProvisioningEvents public function Get provisioning events.
Mapping::getProvisioningModule public function Get provisioning module.
Mapping::getUserTokens public function Get user tokens.
Mapping::hasProvisioningEvent public function Provisioning event available?
Mapping::isBinary public function Mapping is binary.
Mapping::isConfigurable public function Is configurable.
Mapping::isEnabled public function Is enabled.
Mapping::serialize public function Serialized data.
Mapping::setConfigurable public function Mapping set is configurable.
Mapping::setConfigurationModule public function Set configuration module.
Mapping::setDrupalAttribute public function Set Drupal attribute.
Mapping::setEnabled public function Set enabled.
Mapping::setLabel public function Set label.
Mapping::setLdapAttribute public function Set LDAP attribute.
Mapping::setNotes public function Set Notes.
Mapping::setProvisioningEvents public function Set provisioning events.
Mapping::setProvisioningModule public function Set provisioning module.
Mapping::setUserTokens public function Set user tokens.
Mapping::__construct public function Mapping constructor.