elseif ($type == 'Select' || $type == 'Radio') {
$customOption = CRM_Core_BAO_CustomOption::getCustomOption($customFieldID, TRUE);
foreach ($customOption as $customFldID => $customValue) {
- $val = CRM_Utils_Array::value('value', $customValue);
- $label = CRM_Utils_Array::value('label', $customValue);
+ $val = $customValue['value'] ?? NULL;
+ $label = $customValue['label'] ?? NULL;
$label = strtolower($label);
$value = strtolower(trim($value));
if (($value == $label) || ($value == strtolower($val))) {
if (isset($values['email_greeting'])) {
if (!empty($params['email_greeting_id'])) {
$emailGreetingFilter = [
- 'contact_type' => CRM_Utils_Array::value('contact_type', $params),
+ 'contact_type' => $params['contact_type'] ?? NULL,
'greeting_type' => 'email_greeting',
];
$emailGreetings = CRM_Core_PseudoConstant::greeting($emailGreetingFilter);
if (isset($values['postal_greeting'])) {
if (!empty($params['postal_greeting_id'])) {
$postalGreetingFilter = [
- 'contact_type' => CRM_Utils_Array::value('contact_type', $params),
+ 'contact_type' => $params['contact_type'] ?? NULL,
'greeting_type' => 'postal_greeting',
];
$postalGreetings = CRM_Core_PseudoConstant::greeting($postalGreetingFilter);
if (isset($values['addressee'])) {
if (!empty($params['addressee_id'])) {
$addresseeFilter = [
- 'contact_type' => CRM_Utils_Array::value('contact_type', $params),
+ 'contact_type' => $params['contact_type'] ?? NULL,
'greeting_type' => 'addressee',
];
$addressee = CRM_Core_PseudoConstant::addressee($addresseeFilter);
// mark an entry in fields array since we want the value of custom field to be copied
$fields['Address'][$key] = NULL;
- $htmlType = CRM_Utils_Array::value('html_type', $customFields[$customFieldID]);
+ $htmlType = $customFields[$customFieldID]['html_type'] ?? NULL;
switch ($htmlType) {
case 'CheckBox':
case 'Multi-Select':
* <type>
*/
function _civicrm_api3_deprecated_duplicate_formatted_contact($params) {
- $id = CRM_Utils_Array::value('id', $params);
- $externalId = CRM_Utils_Array::value('external_identifier', $params);
+ $id = $params['id'] ?? NULL;
+ $externalId = $params['external_identifier'] ?? NULL;
if ($id || $externalId) {
$contact = new CRM_Contact_DAO_Contact();
if (empty($params['contact_type'])) {
return civicrm_api3_create_error("No Contact Type");
}
- $fields = CRM_Utils_Array::value($params['contact_type'], $required);
+ $fields = $required[$params['contact_type']] ?? NULL;
if ($fields == NULL) {
return civicrm_api3_create_error("Invalid Contact Type: {$params['contact_type']}");
}