You are here

function data_entity_views_data_alter in Data 7

Implements hook_views_data_alter().

File

data_entity/views/data_entity.views.inc, line 10
Contains Views hooks.

Code

function data_entity_views_data_alter(&$data) {
  $tables = data_entity_get_entity_tables();
  foreach ($tables as $table) {
    $table_name = $table
      ->get('name');
    $data[$table_name]['edit_link'] = array(
      'field' => array(
        'title' => t('Edit link'),
        'help' => t('Displays an edit link to the data item'),
        'handler' => 'data_entity_views_handler_field_edit_link',
      ),
    );

    // Support for Editable Views module.
    if ($table->meta['is_entity_type']) {
      $data[$table_name]['table']['entity type'] = 'data_' . $table_name;
    }
  }
}