/** * @return Array */ protected function getEntityMatchesByHash($entityTypeID, $entityID, $matchHash) { $allMatches = DuplicateCommunicationCriterion::loadEntityMatches($entityTypeID, $entityID, $this->getCommunicationType()); foreach ($allMatches as $matches) { if (DuplicateCommunicationCriterion::prepareMatchHash($matches) === $matchHash) { return $matches; } } return null; }
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"); }