*
* @return mixed
*
- * @throws \API_Exception
+ * @noinspection PhpDocMissingThrowsInspection
+ * @noinspection PhpUnhandledExceptionInspection
*/
protected function getSubmittedValue(string $fieldName) {
return $this->getUserJob()['metadata']['submitted_values'][$fieldName];
return ((int) $this->getSubmittedValue('onDuplicate')) === CRM_Import_Parser::DUPLICATE_SKIP;
}
+ /**
+ * Did the user specify duplicates should be filled with missing data.
+ *
+ * @return bool
+ */
+ protected function isFillDuplicates(): bool {
+ return ((int) $this->getSubmittedValue('onDuplicate')) === CRM_Import_Parser::DUPLICATE_FILL;
+ }
+
/**
* Array of the fields that are actually part of the import process
* the position in the array also dictates their position in the import
$values = array_values($row);
try {
- $parser->import($parser->getSubmittedValue('onDuplicate'), $values);
+ $parser->import($values);
}
catch (CiviCRM_API3_Exception $e) {
// When we catch errors here we are not adding to the errors array - mostly