You are here

public function ActivityViewsData::getViewsData in CRM Core 8

Same name and namespace in other branches
  1. 8.3 modules/crm_core_activity/src/ActivityViewsData.php \Drupal\crm_core_activity\ActivityViewsData::getViewsData()
  2. 8.2 modules/crm_core_activity/src/ActivityViewsData.php \Drupal\crm_core_activity\ActivityViewsData::getViewsData()

Returns views data for the entity type.

Return value

array Views data in the format of hook_views_data().

Overrides EntityViewsData::getViewsData

File

modules/crm_core_activity/src/ActivityViewsData.php, line 15

Class

ActivityViewsData
Provides the views data for the activity entity type.

Namespace

Drupal\crm_core_activity

Code

public function getViewsData() {
  $data = parent::getViewsData();
  $data['crm_core_activity']['activity_preview'] = [
    'title' => t('Activity preview field'),
    'field' => [
      'title' => t('Activity preview'),
      'help' => t('Provide preview of activity'),
      'id' => 'activity_preview',
      'field' => 'activity_id',
    ],
  ];
  return $data;
}