You are here

public function MessageViewsData::getViewsData in Contact Storage 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/MessageViewsData.php, line 15

Class

MessageViewsData
Provides data to integrate messages with Views.

Namespace

Drupal\contact_storage

Code

public function getViewsData() {
  $data = parent::getViewsData();
  $data['contact_message']['contact_form_label'] = [
    'title' => $this
      ->t('Form'),
    'help' => $this
      ->t('The label of the associated form.'),
    'real field' => 'contact_form',
    'field' => [
      'id' => 'contact_form',
    ],
  ];
  $data['contact_message']['message_bulk_form'] = [
    'title' => $this
      ->t('Message operations bulk form'),
    'help' => $this
      ->t('Add a form element that lets you run operations on multiple messages.'),
    'field' => [
      'id' => 'message_bulk_form',
    ],
  ];
  return $data;
}