You are here

public function LibraryItemViewsData::getViewsData in Paragraphs 8

Returns views data for the entity type.

Return value

array Views data in the format of hook_views_data().

Overrides EntityViewsData::getViewsData

File

modules/paragraphs_library/src/LibraryItemViewsData.php, line 15

Class

LibraryItemViewsData
Provides the views data for the paragraphs library item entity type.

Namespace

Drupal\paragraphs_library

Code

public function getViewsData() {
  $data = parent::getViewsData();
  $data['paragraphs_library_item_field_data']['paragraphs__target_id']['relationship'] = [
    'title' => $this
      ->t('Paragraph relationship'),
    'help' => $this
      ->t('Allows users to add paragraphs entity fields.'),
    'id' => 'standard',
    'base' => 'paragraphs_item_field_data',
    'base field' => 'id',
    'label' => $this
      ->t('Paragraphs'),
  ];
  return $data;
}