/**
* @inheritDoc
*/
- public function offsetExists($offset) {
+ public function offsetExists($offset): bool {
return in_array($offset, ['entity', 'action', 'params', 'version', 'check_permissions', 'id']) || isset($this->_arrayStorage[$offset]);
}
/**
* @inheritDoc
*/
+ #[\ReturnTypeWillChange]
public function &offsetGet($offset) {
$val = NULL;
if (in_array($offset, ['entity', 'action'])) {
/**
* @inheritDoc
*/
- public function offsetSet($offset, $value) {
+ public function offsetSet($offset, $value): void {
if (in_array($offset, ['entity', 'action', 'entityName', 'actionName', 'params', 'version', 'id'])) {
throw new \API_Exception('Cannot modify api4 state via array access');
}
/**
* @inheritDoc
*/
- public function offsetUnset($offset) {
+ public function offsetUnset($offset): void {
if (in_array($offset, ['entity', 'action', 'entityName', 'actionName', 'params', 'check_permissions', 'version', 'id'])) {
throw new \API_Exception('Cannot modify api4 state via array access');
}
* @return array
*/
public function getPermissions() {
- $permissions = call_user_func([CoreUtil::getApiClass($this->_entityName), 'permissions']);
+ $permissions = call_user_func([CoreUtil::getApiClass($this->_entityName), 'permissions'], $this->_entityName);
$permissions += [
// applies to getFields, getActions, etc.
'meta' => ['access CiviCRM'],
$options = FormattingUtil::getPseudoconstantList($info['field'], $info['expr'], $record, 'create');
$record[$fieldName] = FormattingUtil::replacePseudoconstant($options, $info['val'], TRUE);
}
+ // The DAO works better with ints than booleans. See https://github.com/civicrm/civicrm-core/pull/23970
+ foreach ($record as $key => $value) {
+ if (is_bool($value)) {
+ $record[$key] = (int) $value;
+ }
+ }
}
/**