diff --git a/docs/hooks/hook_civicrm_alterLocationMergeData.md b/docs/hooks/hook_civicrm_alterLocationMergeData.md new file mode 100644 index 0000000000000000000000000000000000000000..4d964608b6f90ec16bbb5b0684cc9bfb6baaad96 --- /dev/null +++ b/docs/hooks/hook_civicrm_alterLocationMergeData.md @@ -0,0 +1,44 @@ +# hook_civicrm_alterLocationMergeData + +## Summary + +This hook allows you to alter the location information that will be moved from +the duplicate contact to the master contact. + +## Availability + +This hook was first available in CiviCRM 4.7.10. + +## Definition + +```php +hook_civicrm_alterLocationMergeData(&$blocksDAO, $mainId, $otherId, $migrationInfo) +``` + +## Parameters + + * array $blocksDAO: Array of location DAO to be saved. These are arrays in 2 keys 'update' & 'delete'. + * int $mainId: Contact ID of the contact that survives the merge. + * int $otherId: Contact ID of the contact that will be absorbed and deleted. + * array $migrationInfo: Calculated migration info. + +## Details + +The $blocksDAO contains a list of 'location blocks' (eg: emails, phones, +addresses) which will be updated or deleted as part of the merge. This is +formatted like: + +```php +[ + email + delete + id => object + update + id => object + address + delete + id => object + update + id => object +] +``` diff --git a/mkdocs.yml b/mkdocs.yml index f8ca7538b6c6417a26834f57c0eb89f1c1400074..30ad57d6a7f21fb35ae30bda7efc3fec23ce842b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -77,6 +77,7 @@ pages: - hook_civicrm_custom: hooks/hook_civicrm_custom.md - hook_civicrm_managed: hooks/hook_civicrm_managed.md - hook_civicrm_merge: hooks/hook_civicrm_merge.md + - hook_civicrm_alterLocationMergeData: hooks/hook_civicrm_alterLocationMergeData.md - hook_civicrm_post: hooks/hook_civicrm_post.md - hook_civicrm_postSave_table_name: hooks/hook_civicrm_postSave_table_name.md - hook_civicrm_pre: hooks/hook_civicrm_pre.md diff --git a/redirects/wiki-crmdoc.txt b/redirects/wiki-crmdoc.txt index 92e332db60f2be351029b4bd425de4d0354ede9f..4639376a63f3aa53a17ab9b244eb09048fc0994a 100644 --- a/redirects/wiki-crmdoc.txt +++ b/redirects/wiki-crmdoc.txt @@ -11,6 +11,7 @@ hook_civicrm_copy hooks/hook_civicrm_copy hook_civicrm_custom hooks/hook_civicrm_custom hook_civicrm_managed hooks/hook_civicrm_managed hook_civicrm_merge hooks/hook_civicrm_merge +hook_civicrm_alterLocationMergeData hooks/hook_civicrm_alterLocationMergeData hook_civicrm_post hooks/hook_civicrm_post hook_civicrm_pre hooks/hook_civicrm_pre hook_civicrm_trigger_info hooks/hook_civicrm_triggerInfo