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 +--------------------------------------------------------------------+
16 * @copyright CiviCRM LLC https://civicrm.org/licensing
20 namespace Civi\Api4\Generic
;
25 class DAOSaveAction
extends AbstractSaveAction
{
26 use Traits\DAOActionTrait
;
31 public function _run(Result
$result) {
32 foreach ($this->records
as &$record) {
33 $record +
= $this->defaults
;
34 $this->formatWriteValues($record);
35 if (empty($record['id'])) {
36 $this->fillDefaults($record);
39 $this->validateValues();
41 $resultArray = $this->writeObjects($this->records
);
43 $result->exchangeArray($resultArray);