You are here

public function MenuLinkContent::getViewsData in Menu Entity Index 8

Returns views data for the entity type.

Return value

array Views data in the format of hook_views_data().

Overrides EntityViewsData::getViewsData

File

src/ViewsData/MenuLinkContent.php, line 18

Class

MenuLinkContent
Provides views integration for menu_link_content entities.

Namespace

Drupal\menu_entity_index\ViewsData

Code

public function getViewsData() {
  $data = parent::getViewsData();
  foreach ($data as $table => $table_data) {
    if (in_array('menu_name', array_keys($table_data))) {
      $data[$table]['menu_name']['field']['id'] = 'menu';
      $data[$table]['menu_name']['filter']['id'] = 'menu';
    }
  }
  return $data;
}