You are here

protected function ViewDisplayAggregatorSensorPlugin::getViewsOptions in Monitoring 8

Gets the available views.

Return value

array Available views list.

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

File

src/Plugin/monitoring/SensorPlugin/ViewDisplayAggregatorSensorPlugin.php, line 136
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 getViewsOptions() {
  $options = [];
  $views = Views::getAllViews();
  foreach ($views as $view) {
    $options[$view
      ->id()] = $view
      ->label();
  }
  return $options;
}