home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (uc_stock_views_handler_filter_below_threshold.inc)

This example Drupal source code file (uc_stock_views_handler_filter_below_threshold.inc) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

class, empty, extends, function, php, query, stock, threshold, uc_stock_views_handler_filter_below_threshold, views_handler_filter_boolean_operator

The uc_stock_views_handler_filter_below_threshold.inc Drupal example source code

<?php
// $Id: uc_stock_views_handler_filter_below_threshold.inc,v 1.1.2.1 2009/07/29 19:54:20 islandusurper Exp $

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

class uc_stock_views_handler_filter_below_threshold extends views_handler_filter_boolean_operator {
  function query() {
    $this->ensure_my_table();
    $this->query->add_field($this->table_alias, 'stock');
    $this->query->add_field($this->table_alias, 'threshold');

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

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal uc_stock_views_handler_filter_below_threshold.inc source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.