You are here

function _mongodb_watchdog_get_message_types in MongoDB 7

Same name and namespace in other branches
  1. 6 mongodb_watchdog/mongodb_watchdog.admin.inc \_mongodb_watchdog_get_message_types()

Gets all available filter types.

Return value

array An array of message type names.

1 call to _mongodb_watchdog_get_message_types()
mongodb_watchdog_filters in mongodb_watchdog/mongodb_watchdog.admin.inc
List mongodb_watchdog administration filters that can be applied.

File

mongodb_watchdog/mongodb_watchdog.admin.inc, line 399
Settings for mongodb. Moved back to module file.

Code

function _mongodb_watchdog_get_message_types() {

  // As of version 1.0.1, the PHP driver doesn't expose the 'distinct' command.
  $collection = mongodb_collection(variable_get('mongodb_watchdog', 'watchdog'));
  $result = $collection->db
    ->command(array(
    'distinct' => $collection
      ->getName(),
    'key' => 'type',
  ));
  return $result['values'];
}