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 if (empty($record['id'])) {
29 $this->fillDefaults($record);
32 $this->validateValues();
34 $resultArray = $this->writeObjects($this->records
);
36 $result->exchangeArray($resultArray);