Skip to content

Instantly share code, notes, and snippets.

@vinmassaro
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinmassaro/e04eb1181824561b3f35 to your computer and use it in GitHub Desktop.
Save vinmassaro/e04eb1181824561b3f35 to your computer and use it in GitHub Desktop.
<?php
function my_module_views_query_alter(&$view, &$query) {
if ($view->name == 'faculty') {
// Traverse through the 'where' part of the query.
foreach ($query->where as &$condition_group) {
foreach ($condition_group['conditions'] as &$condition) {
if (is_object($condition['field'])) {
$conditions = &$condition['field']->conditions();
dpm($conditions[1]['field']->conditions());
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment