You are here

public static function EventTemplate::keys in MongoDB 8.2

List the template keys and their behaviours.

Return value

array[string] A properties by key array.

1 call to EventTemplate::keys()
EventTemplate::bsonUnserialize in modules/mongodb_watchdog/src/EventTemplate.php

File

modules/mongodb_watchdog/src/EventTemplate.php, line 88

Class

EventTemplate
Class EventTemplate models an event template.

Namespace

Drupal\mongodb_watchdog

Code

public static function keys() : array {
  $ret = [
    '_id' => [
      'label' => t('ID'),
    ],
    'changed' => [
      'label' => t('Changed'),
      'creation_callback' => 'intval',
    ],
    'count' => [
      'label' => t('Count'),
      'creation_callback' => 'intval',
    ],
    'type' => [
      'label' => t('Type'),
    ],
    'message' => [
      'label' => t('Message'),
    ],
    'severity' => [
      'label' => t('Severity'),
      'creation_callback' => 'intval',
      'display_callback' => function ($level) {
        return RfcLogLevel::getLevels()[$level];
      },
    ],
  ];
  return $ret;
}