Projet

Général

Profil

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

root / drupal7 / sites / all / modules / views / modules / node / views_handler_sort_node_version_count.inc @ 5d12d676

1
<?php
2

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

    
8
/**
9
 * A handler that sorts on the total count of versions/revisions of a node.
10
 *
11
 * @ingroup views_sort_handlers
12
 */
13
class views_handler_sort_node_version_count extends views_handler_sort {
14

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

    
21
    $this->query->add_orderby(NULL, '(SELECT COUNT(vid) FROM {node_revision} WHERE nid = {' . $this->table_alias . '}.nid)', $this->options['order'], 'sort_node_version_count');
22
  }
23

    
24
}