views_handler_filter_ncs_last_updated.inc

  1. 3.x modules/comment/views_handler_filter_ncs_last_updated.inc
  2. 2.x modules/comment/views_handler_filter_ncs_last_updated.inc

Definition of views_handler_filter_ncs_last_updated.

File

modules/comment/views_handler_filter_ncs_last_updated.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Definition of views_handler_filter_ncs_last_updated.
  5. */
  6. /**
  7. * Filter handler for the newer of last comment / node updated.
  8. *
  9. * @ingroup views_filter_handlers
  10. */
  11. class views_handler_filter_ncs_last_updated extends views_handler_filter_date {
  12. function query() {
  13. $this->ensure_my_table();
  14. $this->node_table = $this->query->ensure_table('node', $this->relationship);
  15. $field = "GREATEST(" . $this->node_table . ".changed, " . $this->table_alias . ".last_comment_timestamp)";
  16. $info = $this->operators();
  17. if (!empty($info[$this->operator]['method'])) {
  18. $this->{$info[$this->operator]['method']}($field);
  19. }
  20. }
  21. }