function dblog_build_filter_query
Builds a query for database log administration filters based on session.
Return value
array An associative array with keys 'where' and 'args'.
1 call to dblog_build_filter_query()
- dblog_overview in modules/
dblog/ dblog.admin.inc - Page callback: Displays a listing of database log messages.
File
-
modules/
dblog/ dblog.admin.inc, line 212
Code
function dblog_build_filter_query() {
if (empty($_SESSION['dblog_overview_filter'])) {
return;
}
$filters = dblog_filters();
// Build query
$where = $args = array();
foreach ($_SESSION['dblog_overview_filter'] as $key => $filter) {
$filter_where = array();
foreach ($filter as $value) {
$filter_where[] = $filters[$key]['where'];
$args[] = $value;
}
if (!empty($filter_where)) {
$where[] = '(' . implode(' OR ', $filter_where) . ')';
}
}
$where = !empty($where) ? implode(' AND ', $where) : '';
return array(
'where' => $where,
'args' => $args,
);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.