• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

modules/comment/views_handler_sort_ncs_last_comment_name.inc

00001 <?php
00008 class views_handler_sort_ncs_last_comment_name extends views_handler_sort {
00009   function query() {
00010     $this->ensure_my_table();
00011     $join = new views_join();
00012     $join->construct('users', $this->table_alias, 'last_comment_uid', 'uid');
00013 
00014     // @todo this might be safer if we had an ensure_relationship rather than guessing
00015     // the table alias. Though if we did that we'd be guessing the relationship name
00016     // so that doesn't matter that much.
00017 //    $this->user_table = $this->query->add_relationship(NULL, $join, 'users', $this->relationship);
00018     $this->user_table = $this->query->ensure_table('ncs_users', $this->relationship, $join);
00019     $this->user_field = $this->query->add_field($this->user_table, 'name');
00020 
00021     // Add the field.
00022     $this->query->add_orderby(NULL, "LOWER(COALESCE($this->user_table.name, $this->table_alias.$this->field))", $this->options['order'], $this->table_alias . '_' . $this->field);
00023   }
00024 }

Generated on Sun Feb 26 2012 12:52:51 for Views by  doxygen 1.7.1