You are here

protected function ExtraFieldViewsPlugin::getViewOptions in Entity Extra Field 2.0.x

Same name and namespace in other branches
  1. 8 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 210

Class

ExtraFieldViewsPlugin
Define extra field views plugin.

Namespace

Drupal\entity_extra_field\Plugin\ExtraFieldType

Code

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

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