You are here

uc_stock_handler_filter_below_threshold.inc in Ubercart 7.3

Views handler: Filter on comparison of stock level to threshold.

File

uc_stock/views/uc_stock_handler_filter_below_threshold.inc
View source
<?php

/**
 * @file
 * Views handler: Filter on comparison of stock level to threshold.
 */

/**
 * Filters nodes based on comparison of stock value to stock threshold.
 */
class uc_stock_handler_filter_below_threshold extends views_handler_filter_boolean_operator {

  /**
   * Overrides views_handler_field::query().
   */
  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");
  }

}

Classes

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