uc_product_handler_filter_product.inc 526 B

123456789101112131415161718192021
  1. <?php
  2. /**
  3. * @file
  4. * Views handler: Node filter on "product-ness".
  5. */
  6. /**
  7. * Filters nodes based on whether they have an entry in the uc_products table.
  8. */
  9. class uc_product_handler_filter_product extends views_handler_filter_boolean_operator {
  10. /**
  11. * Overrides views_handler_field::query().
  12. */
  13. function query() {
  14. $types = uc_product_types();
  15. $this->query->add_field('node', 'type');
  16. $this->query->add_where($this->options['group'], 'node.type', $types, empty($this->value) ? 'NOT IN' : 'IN');
  17. }
  18. }