3 namespace Civi\Api4\Generic
;
6 * Base class for all "Update" api actions
8 * @method $this setValues(array $values) Set all field values from an array of key => value pairs.
9 * @method $this addValue($field, $value) Set field value.
10 * @method array getValues() Get field values.
11 * @method $this setReload(bool $reload) Specify whether complete objects will be returned after saving.
12 * @method bool getReload()
14 * @package Civi\Api4\Generic
16 abstract class AbstractUpdateAction
extends AbstractBatchAction
{
19 * Field values to update.
24 protected $values = [];
27 * Reload objects after saving.
29 * Setting to TRUE will load complete records and return them as the api result.
30 * If FALSE the api usually returns only the fields specified to be updated.
34 protected $reload = FALSE;
41 public function getValue($key) {
42 return isset($this->values
[$key]) ?
$this->values
[$key] : NULL;