You are here

protected function Dblog404SensorPlugin::buildTableHeader in Monitoring 8

Builds the header for a table based on rows.

Do not override this method to define a static header.

Parameters

array $rows: The array of rows for which a header will be built.

Return value

array $header The associative header array for the table.

Overrides DatabaseAggregatorSensorPlugin::buildTableHeader

File

src/Plugin/monitoring/SensorPlugin/Dblog404SensorPlugin.php, line 72
Contains \Drupal\monitoring\Plugin\monitoring\SensorPlugin\Dblog404SensorPlugin.

Class

Dblog404SensorPlugin
Monitors 404 page errors from dblog.

Namespace

Drupal\monitoring\Plugin\monitoring\SensorPlugin

Code

protected function buildTableHeader($rows = []) {
  $header = parent::buildTableHeader($rows);
  if (isset($header['location'])) {

    // A static override of the labels.
    // OK because sensor does not support configurability / instances.
    $header['location'] = $this
      ->t('Path');
    $header['records_count'] = $this
      ->t('Count');
    $header['timestamp'] = $this
      ->t('Last access');
  }
  return $header;
}