3 namespace Civi\Api4\Generic
;
6 * Base class for all batch actions (Update, Delete, Replace).
8 * This differs from the AbstractQuery class in that the "Where" clause is required.
10 * @package Civi\Api4\Generic
12 abstract class AbstractBatchAction
extends AbstractQueryAction
{
15 * Criteria for selecting items to process.
20 protected $where = [];
28 * BatchAction constructor.
29 * @param string $entityName
30 * @param string $actionName
31 * @param string|array $select
32 * One or more fields to load for each item.
34 public function __construct($entityName, $actionName, $select = 'id') {
35 $this->select
= (array) $select;
36 parent
::__construct($entityName, $actionName);
42 protected function getBatchRecords() {
44 'checkPermissions' => $this->checkPermissions
,
45 'where' => $this->where
,
46 'orderBy' => $this->orderBy
,
47 'limit' => $this->limit
,
48 'offset' => $this->offset
,
50 if (empty($this->reload
)) {
51 $params['select'] = $this->select
;
54 return (array) civicrm_api4($this->getEntityName(), 'get', $params);
60 protected function getSelect() {