getLogLevelClassMap example

/** * Gets the watchdog severity constant corresponding to the CSS class. * * @param string $class * CSS class attribute. * * @return int|null * The watchdog severity constant or NULL if not found. */
  protected function getSeverityConstant($class) {
    $map = array_flip(DbLogController::getLogLevelClassMap());

    // Find the class that contains the severity.     $classes = explode(' ', $class);
    foreach ($classes as $class) {
      if (isset($map[$class])) {
        return $map[$class];
      }
    }
    return NULL;
  }

  

  public function overview(Request $request) {

    $filter = $this->buildFilterQuery($request);
    $rows = [];

    $classes = static::getLogLevelClassMap();

    $this->moduleHandler()->loadInclude('dblog', 'admin.inc');

    $build['dblog_filter_form'] = $this->formBuilder()->getForm('Drupal\dblog\Form\DblogFilterForm');

    $header = [
      // Icon column.       '',
      [
        'data' => $this->t('Type'),
        'field' => 'w.type',
        
Home | Imprint | This part of the site doesn't use cookies.