You are here

protected function ViewDisplayAggregatorSensorPlugin::getDisplayOptions in Monitoring 8

Gets the display list for selected view.

Parameters

string $view_id: Selected view.

Return value

array Available displays list.

1 call to ViewDisplayAggregatorSensorPlugin::getDisplayOptions()
ViewDisplayAggregatorSensorPlugin::buildConfigurationForm in src/Plugin/monitoring/SensorPlugin/ViewDisplayAggregatorSensorPlugin.php
Form constructor.

File

src/Plugin/monitoring/SensorPlugin/ViewDisplayAggregatorSensorPlugin.php, line 154
Contains \Drupal\monitoring\Plugin\monitoring\SensorPlugin\ViewDisplayAggregatorSensorPlugin.

Class

ViewDisplayAggregatorSensorPlugin
Execute a view display and count the results.

Namespace

Drupal\monitoring\Plugin\monitoring\SensorPlugin

Code

protected function getDisplayOptions($view_id) {
  $options = [];
  $displays = Views::getView($view_id)->storage
    ->get('display');
  foreach ($displays as $display) {
    $options[$display['id']] = $display['display_title'];
  }
  return $options;
}