uc_order_handler_sort_total.inc 611 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * @file
  4. * Contains uc_order_handler_sort_total.
  5. */
  6. /**
  7. * Sort handler that handles fields generated by table.fieldname * table.qty
  8. * and performs a simple sort.
  9. *
  10. * This sort handler is appropriate for any numeric formula that ends up
  11. * in the query with an alias like "table_field".
  12. */
  13. class uc_order_handler_sort_total extends views_handler_sort {
  14. /**
  15. * Overrides views_handler_sort::query().
  16. */
  17. function query() {
  18. $this->ensure_my_table();
  19. // Add the field.
  20. $this->query->add_orderby(NULL, NULL, $this->options['order'], $this->table . '_' . $this->field);
  21. }
  22. }