BelowThreshold.php in Ubercart 8.4
File
uc_stock/src/Plugin/views/filter/BelowThreshold.php
View source
<?php
namespace Drupal\uc_stock\Plugin\views\filter;
use Drupal\views\Plugin\views\filter\BooleanOperator;
class BelowThreshold extends BooleanOperator {
public 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
Name |
Description |
BelowThreshold |
Filters nodes based on comparison of stock value to stock threshold. |