You are here

public function LdapQuery::buildOptionsForm in Lightweight Directory Access Protocol (LDAP) 8.4

Same name and namespace in other branches
  1. 8.3 ldap_query/src/Plugin/views/query/LdapQuery.php \Drupal\ldap_query\Plugin\views\query\LdapQuery::buildOptionsForm()

Provide a form to edit options for this plugin.

Overrides PluginBase::buildOptionsForm

File

ldap_query/src/Plugin/views/query/LdapQuery.php, line 206

Class

LdapQuery
Views query plugin for an SQL query.

Namespace

Drupal\ldap_query\Plugin\views\query

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) : void {
  parent::buildOptionsForm($form, $form_state);
  $queries = \Drupal::EntityQuery('ldap_query_entity')
    ->condition('status', 1)
    ->execute();
  $form['query_id'] = [
    '#type' => 'select',
    '#options' => $queries,
    '#title' => $this
      ->t('Ldap Query'),
    '#default_value' => $this->options['query_id'],
    '#description' => $this
      ->t('The LDAP query you want Views to use.'),
    '#required' => TRUE,
  ];
}