}
CRM_Core_BAO_Block::sortPrimaryFirst($params['address']);
- $updateBlankLocInfo = CRM_Utils_Array::value('updateBlankLocInfo', $params, FALSE);
+ $updateBlankLocInfo = $params['updateBlankLocInfo'] ?? FALSE;
$contactId = $params['contact_id'];
//get all the addresses for this contact
$addresses = self::allAddress($contactId);
$contactId = $params['contact_id'];
- $updateBlankLocInfo = CRM_Utils_Array::value('updateBlankLocInfo', $params, FALSE);
- $isIdSet = CRM_Utils_Array::value('isIdSet', $params[$blockName], FALSE);
+ $updateBlankLocInfo = $params['updateBlankLocInfo'] ?? FALSE;
+ $isIdSet = $params[$blockName]['isIdSet'] ?? FALSE;
//get existing block ids.
$blockIds = self::getBlockIds($blockName, $contactId, $entityElements);
}
if (empty($params['id'])) {
- $params['is_ssl'] = CRM_Utils_Array::value('is_ssl', $params, FALSE);
- $params['is_default'] = CRM_Utils_Array::value('is_default', $params, FALSE);
+ $params['is_ssl'] = $params['is_ssl'] ?? FALSE;
+ $params['is_default'] = $params['is_default'] ?? FALSE;
}
//handle is_default.
public static function add(&$params) {
$navigation = new CRM_Core_DAO_Navigation();
if (empty($params['id'])) {
- $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
- $params['has_separator'] = CRM_Utils_Array::value('has_separator', $params, FALSE);
+ $params['is_active'] = $params['is_active'] ?? FALSE;
+ $params['has_separator'] = $params['has_separator'] ?? FALSE;
$params['domain_id'] = CRM_Utils_Array::value('domain_id', $params, CRM_Core_Config::domainID());
}
$oldWeight = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFField', !empty($params['id']) ? $params['id'] : $params['field_id'], 'weight', 'id');
}
$fieldValues = ['uf_group_id' => !empty($params['uf_group_id']) ? $params['uf_group_id'] : $params['group_id']];
- return CRM_Utils_Weight::updateOtherWeights('CRM_Core_DAO_UFField', $oldWeight, CRM_Utils_Array::value('weight', $params, 0), $fieldValues);
+ return CRM_Utils_Weight::updateOtherWeights('CRM_Core_DAO_UFField', $oldWeight, $params['weight'] ?? 0, $fieldValues);
}
/**
$view = $field['is_view'];
$required = ($mode == CRM_Profile_Form::MODE_SEARCH) ? FALSE : $field['is_required'];
$search = $mode == CRM_Profile_Form::MODE_SEARCH;
- $isShared = CRM_Utils_Array::value('is_shared', $field, 0);
+ $isShared = $field['is_shared'] ?? 0;
// do not display view fields in drupal registration form
// CRM-4632
], $required);
}
elseif ($fieldName === 'contact_sub_type') {
- $gId = $form->get('gid') ? $form->get('gid') : CRM_Utils_Array::value('group_id', $field);
+ $gId = $form->get('gid') ?: $field['group_id'] ?? NULL;
if ($usedFor == 'onbehalf') {
$profileType = 'Organization';
}
}
elseif (in_array($fieldName, CRM_Contact_BAO_Contact::$_greetingTypes)) {
// Get contact type for greeting selector
- $gId = $form->get('gid') ?: CRM_Utils_Array::value('group_id', $field);
+ $gId = $form->get('gid') ?: $field['group_id'] ?? NULL;
$profileType = CRM_Core_BAO_UFField::getProfileType($gId, TRUE, FALSE, TRUE);
if (!$profileType || in_array($profileType, ['Contact', 'Contribution', 'Participant', 'Membership'])) {
$this->submitOnce = TRUE;
}
- $attrs = ['class' => 'crm-form-submit'] + (array) CRM_Utils_Array::value('js', $button);
+ $attrs = ['class' => 'crm-form-submit'] + ($button['js'] ?? []);
// A lot of forms use the hacky method of looking at
// `$params['button name']` (dating back to them being inputs with a
}
if ($context == 'search') {
$widget = $widget == 'Select2' ? $widget : 'Select';
- $props['multiple'] = CRM_Utils_Array::value('multiple', $props, TRUE);
+ $props['multiple'] = $props['multiple'] ?? TRUE;
}
elseif (!empty($fieldSpec['serialize'])) {
$props['multiple'] = TRUE;
*
*/
public static function addOptionValue(&$params, $optionGroupName, $action, $optionValueID) {
- $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
+ $params['is_active'] = $params['is_active'] ?? FALSE;
// checking if the group name with the given id or name (in $groupParams) exists
$groupParams = ['name' => $optionGroupName, 'is_active' => 1];
$optionGroup = CRM_Core_BAO_OptionGroup::retrieve($groupParams, $defaults);
$urlParts = parse_url($urlString);
$url = CRM_Utils_System::url(
$urlParts['path'],
- CRM_Utils_Array::value('query', $urlParts, NULL),
+ $urlParts['query'] ?? NULL,
$absolute,
CRM_Utils_Array::value('fragment', $urlParts, NULL)
);
*/
public static function &activityType() {
$args = func_get_args();
- $all = CRM_Utils_Array::value(0, $args, TRUE);
- $includeCaseActivities = CRM_Utils_Array::value(1, $args, FALSE);
- $reset = CRM_Utils_Array::value(2, $args, FALSE);
- $returnColumn = CRM_Utils_Array::value(3, $args, 'label');
- $includeCampaignActivities = CRM_Utils_Array::value(4, $args, FALSE);
- $onlyComponentActivities = CRM_Utils_Array::value(5, $args, FALSE);
+ $all = $args[0] ?? TRUE;
+ $includeCaseActivities = $args[1] ?? FALSE;
+ $reset = $args[2] ?? FALSE;
+ $returnColumn = $args[3] ?? 'label';
+ $includeCampaignActivities = $args[4] ?? FALSE;
+ $onlyComponentActivities = $args[5] ?? FALSE;
$index = (int) $all . '_' . $returnColumn . '_' . (int) $includeCaseActivities;
$index .= '_' . (int) $includeCampaignActivities;
$index .= '_' . (int) $onlyComponentActivities;