views_handler_argument_aggregator_iid.inc 746 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * @file
  4. * Definition of views_handler_argument_aggregator_iid.
  5. */
  6. /**
  7. * Argument handler to accept an aggregator item id.
  8. *
  9. * @ingroup views_argument_handlers
  10. */
  11. class views_handler_argument_aggregator_iid extends views_handler_argument_numeric {
  12. /**
  13. * Override the behavior of title(). Get the title of the category.
  14. */
  15. public function title_query() {
  16. $titles = array();
  17. $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d'));
  18. $result = db_select('aggregator_item', 'ai')
  19. ->condition('iid', $this->value, 'IN')
  20. ->fields('ai', array('title'))
  21. ->execute();
  22. foreach ($result as $term) {
  23. $titles[] = check_plain($term->title);
  24. }
  25. return $titles;
  26. }
  27. }