3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * This class acts like a psuedo-BAO for transient import job tables.
21 class CRM_Contact_Import_ImportJob
{
23 protected $_onDuplicate;
25 protected $_newGroupName;
27 protected $_allGroups;
28 protected $_newTagName;
32 protected $_mapperKeys = [];
33 protected $_mapFields;
36 * @var CRM_Contact_Import_Parser_Contact
40 protected $_userJobID;
43 * Has the job completed.
47 public function isComplete(): bool {
48 return $this->_parser
->isComplete();
52 * @param array $params
54 public function setJobParams(&$params) {
55 foreach ($params as $param => $value) {
57 $this->$fldName = $value;
62 * @param CRM_Core_Form $form
65 public function runImport(&$form, $timeout = 55) {
66 $mapper = $this->_mapper
;
67 foreach ($mapper as $key => $value) {
68 $this->_mapperKeys
[$key] = $mapper[$key][0] ??
NULL;
76 public function setFormVariables($form) {
77 $this->_parser
->set($form, CRM_Import_Parser
::MODE_IMPORT
);