You are here

function editor_note_views_data_alter in Editor Notes 7

Implements hook_views_data_alter().

File

./editor_note.module, line 252
Main functionality for Editor Notes module.

Code

function editor_note_views_data_alter(&$data) {

  // Exposes uid as a relationship to users.
  $data['editor_note']['author_info'] = array(
    'title' => t('User information.'),
    'help' => t('Information related to user who authored/updated the note.'),
    'relationship' => array(
      'base' => 'users',
      'base field' => 'uid',
      'relationship field' => 'uid',
      'handler' => 'views_handler_relationship',
      'label' => t('User information.'),
    ),
  );

  // Expose entity_id as a relationship to node (the most common use case).
  $data['editor_note']['node_info'] = array(
    'title' => t('Node information.'),
    'help' => t('Related node object.'),
    'relationship' => array(
      'base' => 'node',
      'base field' => 'nid',
      'relationship field' => 'entity_id',
      'handler' => 'views_handler_relationship',
      'label' => t('Node information.'),
    ),
  );
}