4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC. All rights reserved. |
7 | This work is published under the GNU AGPLv3 license with some |
8 | permitted exceptions and without any warranty. For full license |
9 | and copyright information, see https://civicrm.org/licensing |
10 +--------------------------------------------------------------------+
13 namespace Civi\Api4\Generic
;
18 class DAOSaveAction
extends AbstractSaveAction
{
19 use Traits\DAOActionTrait
;
24 public function _run(Result
$result) {
25 foreach ($this->records
as &$record) {
26 $record +
= $this->defaults
;
27 $this->formatWriteValues($record);
28 $this->matchExisting($record);
29 if (empty($record['id'])) {
30 $this->fillDefaults($record);
33 $this->validateValues();
35 $resultArray = $this->writeObjects($this->records
);
37 $result->exchangeArray($resultArray);