You are here

protected function ExtraFieldViewsPlugin::getViewOptions in Entity Extra Field 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/ExtraFieldType/ExtraFieldViewsPlugin.php \Drupal\entity_extra_field\Plugin\ExtraFieldType\ExtraFieldViewsPlugin::getViewOptions()

Get view options.

Return value

array An array of view options.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

1 call to ExtraFieldViewsPlugin::getViewOptions()
ExtraFieldViewsPlugin::buildConfigurationForm in src/Plugin/ExtraFieldType/ExtraFieldViewsPlugin.php
Form constructor.

File

src/Plugin/ExtraFieldType/ExtraFieldViewsPlugin.php, line 213

Class

ExtraFieldViewsPlugin
Define extra field views plugin.

Namespace

Drupal\entity_extra_field\Plugin\ExtraFieldType

Code

protected function getViewOptions() {
  $options = [];

  /** @var \Drupal\views\Entity\View $view */
  foreach ($this
    ->getActiveViewList() as $view_id => $view) {
    $options[$view_id] = $view
      ->label();
  }
  return $options;
}