DNotes LLC

DNotes LLC

Drupal development, hosting, and consulting

OOP

Views query alter methods

Views is a fantastic module that allows you to build complex database queries through configuration. However, I've found that a weird variation of the 80/20 rule applies to views: 80% of the time, the configuration will get you 100% of what you want, but 20% of the time, it will only get you 80% of what you want. That's where the views hooks are handy, especially hook_views_query_alter. I've used this many times - adding a where clause, modifying a field, etc.

Object Oriented Rose Bush

$rosie = new RoseBush;
$rosie->plant();
$rosie->shred_flesh();
$rosie->fertilize();
$rosie->weed();
$rosie->water();
Subscribe to RSS - OOP