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
22 namespace Civi\Api4\Generic
;
25 * Base class for all "Update" api actions
27 * @method $this setValues(array $values) Set all field values from an array of key => value pairs.
28 * @method $this addValue($field, $value) Set field value.
29 * @method array getValues() Get field values.
30 * @method $this setReload(bool $reload) Specify whether complete objects will be returned after saving.
31 * @method bool getReload()
33 * @package Civi\Api4\Generic
35 abstract class AbstractUpdateAction
extends AbstractBatchAction
{
38 * Field values to update.
43 protected $values = [];
46 * Reload objects after saving.
48 * Setting to TRUE will load complete records and return them as the api result.
49 * If FALSE the api usually returns only the fields specified to be updated.
53 protected $reload = FALSE;
60 public function getValue($key) {
61 return isset($this->values
[$key]) ?
$this->values
[$key] : NULL;