Projet

Général

Profil

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

root / drupal7 / sites / all / modules / views / modules / node / views_handler_sort_node_version_count.inc @ 7547bb19

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
  function query() {
15
    $this->ensure_my_table();
16

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