You are here

protected function DatabaseAggregatorSensorPlugin::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.

8 calls to DatabaseAggregatorSensorPlugin::buildTableHeader()
DatabaseAggregatorSensorPlugin::verboseResultHistory in src/Plugin/monitoring/SensorPlugin/DatabaseAggregatorSensorPlugin.php
Adds history verbose output to the render array $output.
DatabaseAggregatorSensorPlugin::verboseResultUnaggregated in src/Plugin/monitoring/SensorPlugin/DatabaseAggregatorSensorPlugin.php
Adds unaggregated verbose output to the render array $output.
Dblog404SensorPlugin::buildTableHeader in src/Plugin/monitoring/SensorPlugin/Dblog404SensorPlugin.php
Builds the header for a table based on rows.
ImageMissingStyleSensorPlugin::verboseResultCounting in src/Plugin/monitoring/SensorPlugin/ImageMissingStyleSensorPlugin.php
Get the aggregated table verbose output.
NonExistingUserFailedLoginsSensorPlugin::verboseResultCounting in src/Plugin/monitoring/SensorPlugin/NonExistingUserFailedLoginsSensorPlugin.php
Get the verbose results of the attempts per ip.

... See full list

3 methods override DatabaseAggregatorSensorPlugin::buildTableHeader()
Dblog404SensorPlugin::buildTableHeader in src/Plugin/monitoring/SensorPlugin/Dblog404SensorPlugin.php
Builds the header for a table based on rows.
Redirect404SensorPlugin::buildTableHeader in src/Plugin/monitoring/SensorPlugin/Redirect404SensorPlugin.php
Builds the header for a table based on rows.
TemporaryFilesUsagesSensorPlugin::buildTableHeader in src/Plugin/monitoring/SensorPlugin/TemporaryFilesUsagesSensorPlugin.php
Builds the header for a table based on rows.

File

src/Plugin/monitoring/SensorPlugin/DatabaseAggregatorSensorPlugin.php, line 334
Contains \Drupal\monitoring\Plugin\monitoring\SensorPlugin\DatabaseAggregatorSensorPlugin.

Class

DatabaseAggregatorSensorPlugin
Database aggregator able to query a single db table.

Namespace

Drupal\monitoring\Plugin\monitoring\SensorPlugin

Code

protected function buildTableHeader($rows = []) {
  if (empty($rows)) {
    return [];
  }

  // Provide consistent keys for header and data rows for easy altering.
  $keys = array_keys($rows[0]);
  $header = array_combine($keys, $keys);
  return $header;
}