toKeepID; } /** * @param mixed $toKeepID */ public function setToKeepID($toKeepID) { $this->toKeepID = $toKeepID; } /** * @return mixed */ public function getToRemoveID() { return $this->toRemoveID; } /** * @param mixed $toRemoveID */ public function setToRemoveID($toRemoveID) { $this->toRemoveID = $toRemoveID; } /** * CRM_Dedupe_MergeHandler constructor. * * @param int $toKeepID * ID of contact to be kept. * @param int $toRemoveID * ID of contact to be removed. */ public function __construct(int $toKeepID, int $toRemoveID) { $this->setToKeepID($toKeepID); $this->setToRemoveID($toRemoveID); } /** * Get an array of tables that relate to the contact entity and will need consideration in a merge. * * The list of potential tables is filtered by tables which have data for the relevant contacts. */ public function getTablesRelatedToTheMergePair() { $relTables = CRM_Dedupe_Merger::relTables(); $activeRelTables = CRM_Dedupe_Merger::getActiveRelTables($this->toRemoveID); $activeMainRelTables = CRM_Dedupe_Merger::getActiveRelTables($this->toKeepID); foreach ($relTables as $name => $null) { if (!in_array($name, $activeRelTables, TRUE) && !(($name === 'rel_table_users') && in_array($name, $activeMainRelTables, TRUE)) ) { unset($relTables[$name]); } } return $relTables; } }