You are here

function rate_views_data_alter in Rate 8.2

Same name and namespace in other branches
  1. 8 rate.views.inc \rate_views_data_alter()

Implements hook_views_data_alter().

File

./rate.views.inc, line 11
rate.views.inc

Code

function rate_views_data_alter(array &$data) {
  $entity_types = \Drupal::entityTypeManager()
    ->getDefinitions();
  foreach ($entity_types as $entity_type_id => $entity_type) {
    $data[$entity_type_id][$entity_type_id . '_rate_widget_field'] = [
      'title' => t('Rate widget'),
      'field' => [
        'title' => t('Rate widget'),
        'help' => t('Displays a widget to vote this entity.'),
        'id' => 'rate_widget_field',
      ],
    ];
  }
}