You are here

public function LdapQuery::addWhere in Lightweight Directory Access Protocol (LDAP) 8.3

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

File

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

Class

LdapQuery
Views query plugin for an SQL query.

Namespace

Drupal\ldap_query\Plugin\views\query

Code

public function addWhere($group, $field, $value = NULL, $operator = NULL) {

  // Ensure all variants of 0 are actually 0. Thus '', 0 and NULL are all
  // the default group.
  if (empty($group)) {
    $group = 0;
  }

  // Check for a group.
  if (!isset($this->where[$group])) {
    $this
      ->setWhereGroup('AND', $group);
  }
  if (!empty($operator) && $operator != 'LIKE') {
    $this->where[$group]['conditions'][] = [
      'field' => $field,
      'value' => $value,
      'operator' => $operator,
    ];
  }
}