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

Drupal example source code file (uc_product_handler_filter_product.inc)

This example Drupal source code file (uc_product_handler_filter_product.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

database, db_placeholders, extends, function, in, not, php, query, sql, types, uc_product_handler_filter_product, uc_product_types, varchar, views_handler_filter_boolean_operator

The uc_product_handler_filter_product.inc Drupal example source code

// $Id: uc_product_handler_filter_product.inc,v 2009/01/02 20:18:40 islandusurper Exp $

 * @file
 * Views handler: Node filter on "product-ness".

 * Filter nodes based on whether they have an entry in the uc_products table.
class uc_product_handler_filter_product extends views_handler_filter_boolean_operator {
  function query() {
    $types = uc_product_types();
    $this->query->add_field('node', 'type');
    $this->query->add_where($this->options['group'], "node.type ". (empty($this->value) ? "NOT " : "") ."IN (". db_placeholders($types, 'varchar') .")", $types);

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal uc_product_handler_filter_product.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.