$params['preferred_communication_method'] = 'null';
}
- $group = $params['group'] ?? NULL;
- $params['group'] = ($params['group'] == '') ? [] : $params['group'];
- if (!empty($group)) {
- $group = is_array($group) ? $group : explode(',', $group);
- $params['group'] = [];
- foreach ($group as $key => $value) {
- $params['group'][$value] = 1;
- }
+ if (array_key_exists('group', $params)) {
+ $group = is_array($params['group']) ? $params['group'] : explode(',', $params['group']);
+ $params['group'] = array_fill_keys($group, 1);
}
if (!empty($params['image_URL'])) {