Created
April 28, 2020 13:52
-
-
Save jackrabbithanna/94d2f6cf222a01a657200d01b96882c8 to your computer and use it in GitHub Desktop.
Contact -> User, User -> Contact hook_views_data_alter()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$data['civicrm_contact']['user'] = [ | |
'title' => 'User related to the CiviCRM contact', | |
'help' => 'Relate user to the CiviCRM contact.', | |
'relationship' => [ | |
'base' => 'users_field_data', | |
'base field' => 'uid', | |
'first field' => 'contact_id', | |
'second field' => 'uf_id', | |
'id' => 'civicrm_entity_civicrm_contact_user', | |
'label' => 'User', | |
], | |
]; | |
$data['users_field_data']['civicrm_contact'] = [ | |
'title' => 'CiviCRM contact related to the user', | |
'help' => 'Relate CiviCRM contact to the user.', | |
'relationship' => [ | |
'base' => 'civicrm_contact', | |
'base field' => 'id', | |
'first field' => 'uf_id', | |
'second field' => 'contact_id', | |
'id' => 'civicrm_entity_civicrm_contact_user', | |
'label' => 'CiviCRM contact', | |
], | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment