views_handler_argument_group_by_numeric.inc 716 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * @file
  4. * Definition of views_handler_argument_group_by_numeric.
  5. */
  6. /**
  7. * Simple handler for arguments using group by.
  8. *
  9. * @ingroup views_argument_handlers
  10. */
  11. class views_handler_argument_group_by_numeric extends views_handler_argument {
  12. function query($group_by = FALSE) {
  13. $this->ensure_my_table();
  14. $field = $this->get_field();
  15. $placeholder = $this->placeholder();
  16. $this->query->add_having_expression(0, "$field = $placeholder", array($placeholder => $this->argument));
  17. }
  18. function ui_name($short = FALSE) {
  19. return $this->get_field(parent::ui_name($short));
  20. }
  21. function get_sort_name() {
  22. return t('Numerical', array(), array('context' => 'Sort order'));
  23. }
  24. }