uc_product_kit_handler_filter_product_kit_item.inc 542 B

1234567891011121314151617181920
  1. <?php
  2. /**
  3. * @file
  4. * Views handler: Node filter on "product-kit-part-ness".
  5. */
  6. /**
  7. * Filters nodes based on whether they are part of a product kit.
  8. */
  9. class uc_product_kit_handler_filter_product_kit_item extends views_handler_filter_boolean_operator {
  10. /**
  11. * Overrides views_handler_field::query().
  12. */
  13. function query() {
  14. $this->query->add_field('node', 'nid');
  15. $this->query->add_where($this->options['group'], "node.nid " . (empty($this->value) ? "NOT " : "") . "IN (SELECT product_id FROM {uc_product_kits})");
  16. }
  17. }