You are here

function commerce_product_reference_handler_filter_product_line_item_type::query in Commerce Core 7

Query against the line item's type column using an IN() condition.

Overrides views_handler_filter_boolean_operator::query

File

modules/product_reference/includes/views/handlers/commerce_product_reference_handler_filter_product_line_item_type.inc, line 34

Class

commerce_product_reference_handler_filter_product_line_item_type
Filter line items by whether or not they are of a product line item type.

Code

function query() {
  $this
    ->ensure_my_table();
  $field = "{$this->table_alias}.type";
  $types = commerce_product_line_item_types();
  $operator = empty($this->value) ? 'not in' : 'in';
  $this->query
    ->add_where($this->options['group'], $field, $types, $operator);
}