Projet

Général

Profil

Paste
Télécharger (711 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / views / modules / tracker / views_handler_filter_tracker_boolean_operator.inc @ 5d12d676

1
<?php
2

    
3
/**
4
 * @file
5
 * Definition of views_handler_filter_tracker_boolean_operator.
6
 */
7

    
8
/**
9
 * Filter handler for boolean values to use = 1 instead of <> 0.
10
 */
11
class views_handler_filter_tracker_boolean_operator extends views_handler_filter_boolean_operator {
12

    
13
  /**
14
   * {@inheritdoc}
15
   */
16
  public function query() {
17
    $this->ensure_my_table();
18
    $where = "$this->table_alias.$this->real_field ";
19
    if (empty($this->value)) {
20
      $where .= '= 0';
21
      if ($this->accept_null) {
22
        $where = '(' . $where . " OR $this->table_alias.$this->real_field IS NULL)";
23
      }
24
    }
25
    else {
26
      $where .= '= 1';
27
    }
28
    $this->query->add_where_expression($this->options['group'], $where);
29
  }
30

    
31
}