foreach ($matchedIDs as $contactId) {
$formatted['contact_id'] = $contactId;
$formatted['version'] = 3;
- $newParticipant = _civicrm_api3_deprecated_create_participant_formatted($formatted, $onDuplicate);
+ $newParticipant = $this->deprecated_create_participant_formatted($formatted, $onDuplicate);
}
}
}
}
}
- $newParticipant = _civicrm_api3_deprecated_create_participant_formatted($formatted, $onDuplicate);
+ $newParticipant = $this->deprecated_create_participant_formatted($formatted, $onDuplicate);
}
if (is_array($newParticipant) && civicrm_error($newParticipant)) {
return NULL;
}
+ /**
+ * @deprecated - this is part of the import parser not the API & needs to be moved on out
+ *
+ * @param array $params
+ * @param $onDuplicate
+ *
+ * @return array|bool
+ * <type>
+ */
+ protected function deprecated_create_participant_formatted($params, $onDuplicate) {
+ if ($onDuplicate != CRM_Import_Parser::DUPLICATE_NOCHECK) {
+ CRM_Core_Error::reset();
+ $error = _civicrm_api3_deprecated_participant_check_params($params, TRUE);
+ if (civicrm_error($error)) {
+ return $error;
+ }
+ }
+ return civicrm_api3_participant_create($params);
+ }
+
}
return civicrm_api3_create_success(TRUE);
}
-/**
- * @deprecated - this is part of the import parser not the API & needs to be moved on out
- *
- * @param array $params
- * @param $onDuplicate
- *
- * @return array|bool
- * <type>
- */
-function _civicrm_api3_deprecated_create_participant_formatted($params, $onDuplicate) {
- require_once 'CRM/Event/Import/Parser.php';
- if ($onDuplicate != CRM_Import_Parser::DUPLICATE_NOCHECK) {
- CRM_Core_Error::reset();
- $error = _civicrm_api3_deprecated_participant_check_params($params, TRUE);
- if (civicrm_error($error)) {
- return $error;
- }
- }
- require_once "api/v3/Participant.php";
- return civicrm_api3_participant_create($params);
-}
-
/**
*
* @param array $params