-
-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ecdb51
commit 9f168b3
Showing
7 changed files
with
181 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,42 @@ | ||
<?php | ||
|
||
/* | ||
+--------------------------------------------------------------------+ | ||
| Copyright CiviCRM LLC. All rights reserved. | | ||
| | | ||
| This work is published under the GNU AGPLv3 license with some | | ||
| permitted exceptions and without any warranty. For full license | | ||
| and copyright information, see https://civicrm.org/licensing | | ||
+--------------------------------------------------------------------+ | ||
*/ | ||
|
||
namespace Civi\Api4\Import; | ||
|
||
use Civi\Api4\Generic\DAOGetAction; | ||
use Civi\Api4\Generic\Result; | ||
|
||
class Import extends DAOGetAction { | ||
|
||
use ImportProcessTrait; | ||
|
||
/** | ||
* @throws \CRM_Core_Exception | ||
*/ | ||
public function _run(Result $result): void { | ||
$userJobID = (int) str_replace('Import_', '', $this->_entityName); | ||
$where = $this->where; | ||
$this->addWhere('_status', 'IN', ['new', 'valid']); | ||
$this->getImportRows($result); | ||
$parser = $this->getParser($userJobID); | ||
foreach ($result as $row) { | ||
$parser->import(array_values($row)); | ||
} | ||
$parser->doPostImportActions(); | ||
|
||
// Re-fetch the validated result with updated messages. | ||
$this->where = $where; | ||
$this->addSelect('*'); | ||
parent::_run($result); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters