Recursive helper to add a namespace to conditions.
Similar to _views_query_tag_alter_condition().
(Though why is the condition we get in a simple query 3 levels deep???)
function alter_subquery_condition(AlterableInterface $query, &$conditions) {
foreach ($conditions as $condition_id => &$condition) {
// Skip the #conjunction element.
if (is_numeric($condition_id)) {
if (is_string($condition['field'])) {
$condition['field'] = $this
->condition_namespace($condition['field']);
}
elseif (is_object($condition['field'])) {
$sub_conditions =& $condition['field']
->conditions();
$this
->alter_subquery_condition($query, $sub_conditions);
}
}
}
}