You are here

protected function OverviewController::buildMainTableRows in MongoDB 8.2

Build the main table rows.

Parameters

\Drupal\mongodb_watchdog\EventTemplate[] $templates: The event template data.

Return value

array A render array for a table.

1 call to OverviewController::buildMainTableRows()
OverviewController::buildMainTable in modules/mongodb_watchdog/src/Controller/OverviewController.php
Build the main table.

File

modules/mongodb_watchdog/src/Controller/OverviewController.php, line 189

Class

OverviewController
The controller for the logger overview page.

Namespace

Drupal\mongodb_watchdog\Controller

Code

protected function buildMainTableRows(array $templates) : array {
  $rows = [];
  $levels = RfcLogLevel::getLevels();
  foreach ($templates as $template) {
    $row = [];
    $row[] = $template->count;
    $row[] = $this->dateFormatter
      ->format($template->changed, 'short');
    $row[] = [
      'class' => static::SEVERITY_CLASSES[$template->severity],
      'data' => $levels[$template->severity],
    ];
    $row[] = $template->type;
    $row[] = $this
      ->getEventLink($template);
    $row[] = [
      'data' => $this
        ->getEventSource($template),
    ];
    $rows[] = $row;
  }
  return $rows;
}