You are here

private function ViewsReferenceItem::getAllViewsNames in Views Reference Field 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldType/ViewsReferenceItem.php \Drupal\viewsreference\Plugin\Field\FieldType\ViewsReferenceItem::getAllViewsNames()

Helper function to get all View Names.

1 call to ViewsReferenceItem::getAllViewsNames()
ViewsReferenceItem::fieldSettingsForm in src/Plugin/Field/FieldType/ViewsReferenceItem.php
Returns a form for the field-level settings.

File

src/Plugin/Field/FieldType/ViewsReferenceItem.php, line 213

Class

ViewsReferenceItem
Defines the 'viewsreference' entity field type.

Namespace

Drupal\viewsreference\Plugin\Field\FieldType

Code

private function getAllViewsNames() {
  $views = Views::getEnabledViews();
  $options = [];
  foreach ($views as $view) {
    $options[$view
      ->get('id')] = $view
      ->get('label');
  }
  return $options;
}