function finder_wheres in Finder 6
Same name and namespace in other branches
- 7 finder.module \finder_wheres()
1 call to finder_wheres()
File
- ./
finder.module, line 1199 - The finder module.
Code
function finder_wheres($wheres) {
$operator = isset($wheres['#operator']) ? $wheres['#operator'] : 'AND';
unset($wheres['#operator']);
foreach ($wheres as $key => $where) {
if (is_array($where)) {
$finder_wheres = finder_wheres($where);
if ($finder_wheres) {
$wheres[$key] = '(' . $finder_wheres . ')';
}
else {
unset($wheres[$key]);
}
}
}
return implode(' ' . $operator . ' ', $wheres);
}