$parser = new CRM_Contact_Import_Parser_Contact($mapper);
$parser->setMaxLinesToProcess(100);
$parser->setUserJobID($this->getUserJobID());
- $parser->run(NULL,
+ $parser->run(
[],
- CRM_Import_Parser::MODE_MAPFIELD,
- $this->getSubmittedValue('contactType'),
- '_id',
- '_status',
- CRM_Import_Parser::DUPLICATE_SKIP,
- NULL, NULL, FALSE,
- CRM_Contact_Import_Parser_Contact::DEFAULT_TIMEOUT,
- $this->getSubmittedValue('contactSubType'),
- $this->getSubmittedValue('dedupe_rule_id')
+ CRM_Import_Parser::MODE_MAPFIELD
);
// add all the necessary variables to the form
$parser->run(NULL,
$mapper,
- CRM_Import_Parser::MODE_PREVIEW,
- NULL,
- '_id',
- '_status',
- (int) $this->getSubmittedValue('onDuplicate'),
- NULL, NULL, FALSE,
- CRM_Contact_Import_Parser_Contact::DEFAULT_TIMEOUT,
- $this->getSubmittedValue('contactSubType'),
- $this->getSubmittedValue('dedupe_rule_id')
+ CRM_Import_Parser::MODE_PREVIEW
);
return $parser;
}
$parserParameters['relatedContactWebsiteType']
);
$this->_parser->setUserJobID($this->_userJobID);
- $this->_parser->run(NULL, $mapperFields,
+ $this->_parser->run(
+ $mapperFields,
CRM_Import_Parser::MODE_IMPORT,
- $this->_contactType,
- $this->_primaryKeyName,
- $this->_statusFieldName,
- $this->_onDuplicate,
$this->_statusID,
- $this->_totalRowCount,
- $this->_doGeocodeAddress,
- CRM_Contact_Import_Parser_Contact::DEFAULT_TIMEOUT,
- $this->_contactSubType,
- $this->_dedupe
+ $this->_totalRowCount
);
$contactIds = $this->_parser->getImportedContacts();
/**
* Run import.
*
- * @param string $tableName
* @param array $mapper
* @param int $mode
- * @param int $contactType
- * @param string $primaryKeyName
- * @param string $statusFieldName
- * @param int $onDuplicate
* @param int $statusID
* @param int $totalRowCount
*
* @return mixed
- * @throws \API_Exception
+ * @throws \API_Exception|\CRM_Core_Exception
*/
public function run(
- $tableName,
$mapper = [],
$mode = self::MODE_PREVIEW,
- $contactType = self::CONTACT_INDIVIDUAL,
- $primaryKeyName = '_id',
- $statusFieldName = '_status',
- $onDuplicate = self::DUPLICATE_SKIP,
$statusID = NULL,
$totalRowCount = NULL
) {