$paramValues['contact_type'] = $this->_contactType;
}
- $paramValues['version'] = 3;
- //retrieve contact id using contact dedupe rule
- require_once 'CRM/Utils/DeprecatedUtils.php';
- $error = _civicrm_api3_deprecated_check_contact_dedupe($paramValues);
+ $error = $this->checkContactDuplicate($paramValues);
if (CRM_Core_Error::isAPIError($error, CRM_Core_ERROR::DUPLICATE_CONTACT)) {
$matchedIDs = explode(',', $error['error_message']['params'][0]);
protected $_mapperKeys;
private $_contactIdIndex;
-
- //private $_totalAmountIndex;
-
private $_eventIndex;
private $_participantStatusIndex;
private $_participantRoleIndex;
}
if ($this->_contactIdIndex < 0) {
-
- //retrieve contact id using contact dedupe rule
- $formatValues['contact_type'] = $this->_contactType;
- $formatValues['version'] = 3;
- $error = _civicrm_api3_deprecated_check_contact_dedupe($formatValues);
+ $error = $this->checkContactDuplicate($formatValues);
if (CRM_Core_Error::isAPIError($error, CRM_Core_ERROR::DUPLICATE_CONTACT)) {
$matchedIDs = explode(',', $error['error_message']['params'][0]);
return $fileName;
}
+ /**
+ * Check if contact is a duplicate .
+ *
+ * @param array $formatValues
+ *
+ * @return array
+ */
+ protected function checkContactDuplicate(&$formatValues) {
+ //retrieve contact id using contact dedupe rule
+ $formatValues['contact_type'] = $this->_contactType;
+ $formatValues['version'] = 3;
+ require_once 'CRM/Utils/DeprecatedUtils.php';
+ $error = _civicrm_api3_deprecated_check_contact_dedupe($formatValues);
+ return $error;
+ }
+
}
$joinDate = CRM_Utils_Date::customFormat(CRM_Utils_Array::value('join_date', $formatted), '%Y-%m-%d');
if ($this->_contactIdIndex < 0) {
-
- //retrieve contact id using contact dedupe rule
- $formatValues['contact_type'] = $this->_contactType;
- $formatValues['version'] = 3;
- require_once 'CRM/Utils/DeprecatedUtils.php';
- $error = _civicrm_api3_deprecated_check_contact_dedupe($formatValues);
+ $error = $this->checkContactDuplicate($formatValues);
if (CRM_Core_Error::isAPIError($error, CRM_Core_ERROR::DUPLICATE_CONTACT)) {
$matchedIDs = explode(',', $error['error_message']['params'][0]);