Projet

Général

Profil

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

root / drupal7 / sites / all / modules / views / modules / comment / views_handler_filter_comment_user_uid.inc @ 5d12d676

1
<?php
2

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

    
8
/**
9
 * Filter handler to accept a user id to check for nodes that user posted or
10
 * commented on.
11
 *
12
 * @ingroup views_filter_handlers
13
 */
14
class views_handler_filter_comment_user_uid extends views_handler_filter_user_name {
15

    
16
  /**
17
   * {@inheritdoc}
18
   */
19
  public function query() {
20
    $this->ensure_my_table();
21

    
22
    $subselect = db_select('comment', 'c');
23
    $subselect->addField('c', 'cid');
24
    $subselect->condition('c.uid', $this->value, $this->operator);
25
    $subselect->where("c.nid = $this->table_alias.nid");
26

    
27
    $condition = db_or()
28
      ->condition("$this->table_alias.uid", $this->value, $this->operator)
29
      ->exists($subselect);
30

    
31
    $this->query->add_where($this->options['group'], $condition);
32
  }
33

    
34
}