You are here

LdapVariableAttribute.php in Lightweight Directory Access Protocol (LDAP) 8.3

File

ldap_query/src/Plugin/views/argument/LdapVariableAttribute.php
View source
<?php

namespace Drupal\ldap_query\Plugin\views\argument;

use Drupal\ldap_query\Plugin\views\VariableAttributeCustomization;

/**
 * Let's the user choose which LDAP attribute to use from the query.
 *
 * @ingroup views_argument_handlers
 *
 * @ViewsArgument("ldap_variable_attribute")
 */
class LdapVariableAttribute extends LdapAttribute {
  use VariableAttributeCustomization;

  /**
   * {@inheritdoc}
   */
  public function query($group_by = FALSE) {
    parent::query($group_by);
    $this->realField = $this->options['attribute_name'];
    $this->query
      ->addWhere(0, $this->realField, $this->argument, '=');
  }

}

Classes

Namesort descending Description
LdapVariableAttribute Let's the user choose which LDAP attribute to use from the query.