You are here

public function VoteViewsData::getViewsData in Voting API 8.3

Returns views data for the entity type.

Return value

array Views data in the format of hook_views_data().

Overrides EntityViewsData::getViewsData

File

src/Entity/VoteViewsData.php, line 16

Class

VoteViewsData
Provides Views data for Vote entities.

Namespace

Drupal\votingapi\Entity

Code

public function getViewsData() {
  $data = parent::getViewsData();
  $data['votingapi_vote']['table']['base'] = [
    'field' => 'id',
    'title' => $this
      ->t('Vote'),
    'help' => $this
      ->t('The Vote ID.'),
  ];
  return $data;
}