You are here

function uc_stock_handler_filter_below_threshold::query in Ubercart 7.3

Overrides views_handler_field::query().

Overrides views_handler_filter_boolean_operator::query

File

uc_stock/views/uc_stock_handler_filter_below_threshold.inc, line 16
Views handler: Filter on comparison of stock level to threshold.

Class

uc_stock_handler_filter_below_threshold
Filters nodes based on comparison of stock value to stock threshold.

Code

function query() {
  $this
    ->ensure_my_table();
  $this->query
    ->add_where_expression($this->options['group'], "{$this->table_alias}.stock " . (empty($this->value) ? '>=' : '<') . " {$this->table_alias}.threshold");
}