/** * @inheritDoc * @param array|\Civi\API\V4\Action $apiRequest * @return array|mixed */ public function invoke($apiRequest) { $result = new Result(); $result->action = $apiRequest['action']; $result->entity = $apiRequest['entity']; $apiRequest->_run($result); return $result; }
public function _run(Result $result) { // First run the parent action (get) $this->select = array('id'); parent::_run($result); // Then act on the result foreach ($result as $item) { // update it } return $result; }