Commit dff6d5a0 authored by RoSk0's avatar RoSk0

Added relation reverse references data for views.

parent 0cc156c7
......@@ -93,3 +93,36 @@ function crm_core_user_sync_user_view(array &$build, UserInterface $account, Ent
}
}
}
/**
* Implements hook_views_data_alter().
*
* @todo Remove once https://www.drupal.org/project/drupal/issues/2706431 is
* resolved.
*/
function crm_core_user_sync_views_data_alter(array &$data) {
$title = t('CRM Core User Sync Relation');
$data['users_field_data']['crm_core_user_sync_relation'] = [
'title' => $title,
'help' => t('Adds relation to CRM Core User Sync Relation that point to current user.'),
'relationship' => [
'base' => 'crm_core_user_sync_relation',
'base field' => 'user_id',
'field' => 'uid',
'id' => 'standard',
'label' => $title,
],
];
$data['crm_core_individual']['crm_core_user_sync_relation'] = [
'title' => $title,
'help' => t('Adds relation to CRM Core User Sync Relation that point to current individual.'),
'relationship' => [
'base' => 'crm_core_user_sync_relation',
'base field' => 'individual_id',
'field' => 'individual_id',
'id' => 'standard',
'label' => $title,
],
];
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment