public static function getMatchHash($typeID, array $matches) { if ($typeID === DuplicateIndexType::PERSON) { return DuplicatePersonCriterion::prepareMatchHash($matches); } elseif ($typeID === DuplicateIndexType::ORGANIZATION) { return DuplicateOrganizationCriterion::prepareMatchHash($matches); } elseif ($typeID === DuplicateIndexType::COMMUNICATION_EMAIL || $typeID === DuplicateIndexType::COMMUNICATION_PHONE) { return DuplicateCommunicationCriterion::prepareMatchHash($matches); } throw new Main\NotSupportedException("Criterion type(s): '" . DuplicateIndexType::resolveName($typeID) . "' is not supported in current context"); }
/** * @return Array */ protected function getEntityMatchesByHash($entityTypeID, $entityID, $matchHash) { $matches = DuplicateOrganizationCriterion::loadEntityMatches($entityTypeID, $entityID); return DuplicateOrganizationCriterion::prepareMatchHash($matches) === $matchHash ? $matches : null; }