foreach ($result as $id => $activity) {
$activities[$id] = [
'activity_id' => $activity['id'],
- 'activity_date_time' => CRM_Utils_Array::value('activity_date_time', $activity),
- 'subject' => CRM_Utils_Array::value('subject', $activity),
+ 'activity_date_time' => $activity['activity_date_time'] ?? NULL,
+ 'subject' => $activity['subject'] ?? NULL,
'assignee_contact_name' => CRM_Utils_Array::value('assignee_contact_sort_name', $activity, []),
- 'source_contact_id' => CRM_Utils_Array::value('source_contact_id', $activity),
- 'source_contact_name' => CRM_Utils_Array::value('source_contact_sort_name', $activity),
+ 'source_contact_id' => $activity['source_contact_id'] ?? NULL,
+ 'source_contact_name' => $activity['source_contact_sort_name'] ?? NULL,
];
$activities[$id]['activity_type_name'] = CRM_Core_PseudoConstant::getName('CRM_Activity_BAO_Activity', 'activity_type_id', $activity['activity_type_id']);
$activities[$id]['activity_type'] = CRM_Core_PseudoConstant::getLabel('CRM_Activity_BAO_Activity', 'activity_type_id', $activity['activity_type_id']);
'is_deleted' => 0,
'is_current_revision' => 1,
'is_test' => 0,
- 'contact_id' => CRM_Utils_Array::value('contact_id', $params),
- 'activity_date_time' => CRM_Utils_Array::value('activity_date_time', $params),
+ 'contact_id' => $params['contact_id'] ?? NULL,
+ 'activity_date_time' => $params['activity_date_time'] ?? NULL,
'check_permissions' => 1,
'options' => [
'offset' => CRM_Utils_Array::value('offset', $params, 0),
$displayLabels = CRM_Core_OptionGroup::values('activity_type', FALSE, FALSE, FALSE, 'AND v.value = ' . $activity_type_id, 'label');
$this->_activityType = [
- 'machineName' => CRM_Utils_Array::value($activity_type_id, $machineNames),
- 'displayLabel' => CRM_Utils_Array::value($activity_type_id, $displayLabels),
+ 'machineName' => $machineNames[$activity_type_id] ?? NULL,
+ 'displayLabel' => $displayLabels[$activity_type_id] ?? NULL,
'id' => $activity_type_id,
];
}
$formValues = $this->controller->exportValues($this->_name);
$params = [
- 'name' => CRM_Utils_Array::value('name', $formValues),
- 'label' => CRM_Utils_Array::value('label', $formValues),
- 'class' => CRM_Utils_Array::value('class', $formValues),
+ 'name' => $formValues['name'] ?? NULL,
+ 'label' => $formValues['label'] ?? NULL,
+ 'class' => $formValues['class'] ?? NULL,
'is_active' => CRM_Utils_Array::value('is_active', $formValues, FALSE),
'is_counted' => CRM_Utils_Array::value('is_counted', $formValues, FALSE),
- 'weight' => CRM_Utils_Array::value('weight', $formValues),
- 'visibility_id' => CRM_Utils_Array::value('visibility_id', $formValues),
+ 'weight' => $formValues['weight'] ?? NULL,
+ 'visibility_id' => $formValues['visibility_id'] ?? NULL,
];
// make sure a malicious POST does not change these on reserved statuses
$values['action'] = CRM_Core_Action::formLink($links, $action,
[
'id' => $object->id,
- 'orig_id' => CRM_Utils_Array::value($object->id, $this->_revertible),
+ 'orig_id' => $this->_revertible[$object->id] ?? NULL,
],
ts('more'),
FALSE,
}
$formDates = [
- 'end_date' => CRM_Utils_Array::value('membership_end_date', $value),
- 'start_date' => CRM_Utils_Array::value('membership_start_date', $value),
+ 'end_date' => $value['membership_end_date'] ?? NULL,
+ 'start_date' => $value['membership_start_date'] ?? NULL,
];
$membershipSource = CRM_Utils_Array::value('source', $value);
list($membership) = CRM_Member_BAO_Membership::processMembership(
'activity_date_time' => date('YmdHis'),
'status_id' => $statusHeld,
'skipRecentView' => 1,
- 'campaign_id' => CRM_Utils_Array::value('campaign_id', $this->_surveyDetails),
+ 'campaign_id' => $this->_surveyDetails['campaign_id'] ?? NULL,
];
$activity = CRM_Activity_BAO_Activity::create($activityParams);
if ($activity->id) {
[
'groupName' => 'msg_tpl_workflow_case',
'valueName' => 'case_activity',
- 'contactId' => CRM_Utils_Array::value('contact_id', $info),
+ 'contactId' => $info['contact_id'] ?? NULL,
'tplParams' => $tplParams,
'from' => $receiptFrom,
'toName' => $displayName,
foreach ($form->_oldCaseStatus as $statuskey => $statusval) {
if ($activity->subject == 'null') {
$activity->subject = ts('Case status changed from %1 to %2', [
- 1 => CRM_Utils_Array::value($statusval, $form->_caseStatus),
- 2 => CRM_Utils_Array::value($params['case_status_id'], $form->_caseStatus),
+ 1 => $form->_caseStatus[$statusval] ?? NULL,
+ 2 => $form->_caseStatus[$params['case_status_id']] ?? NULL,
]);
$activity->save();
}
if ($activity->subject == 'null') {
$activity->subject = ts('Case type changed from %1 to %2',
[
- 1 => CRM_Utils_Array::value($form->_defaults['case_type_id'], $allCaseTypes),
- 2 => CRM_Utils_Array::value($params['case_type_id'], $allCaseTypes),
+ 1 => $allCaseTypes[$form->_defaults['case_type_id']] ?? NULL,
+ 2 => $allCaseTypes[$params['case_type_id']] ?? NULL,
]
);
$activity->save();
'creatorID' => $form->_currentUserId,
'standardTimeline' => 1,
'activityTypeName' => 'Change Case Type',
- 'activity_date_time' => CRM_Utils_Array::value('reset_date_time', $params),
+ 'activity_date_time' => $params['reset_date_time'] ?? NULL,
'caseID' => $caseId,
- 'resetTimeline' => CRM_Utils_Array::value('is_reset_timeline', $params),
+ 'resetTimeline' => $params['is_reset_timeline'] ?? NULL,
];
$xmlProcessor->run($caseType, $xmlProcessorParams);
'subject' => $params['activity_subject'],
'location' => $params['location'],
'activity_date_time' => $params['start_date'],
- 'duration' => CRM_Utils_Array::value('duration', $params),
+ 'duration' => $params['duration'] ?? NULL,
'medium_id' => $params['medium_id'],
'details' => $params['activity_details'],
- 'relationship_end_date' => CRM_Utils_Array::value('end_date', $params),
+ 'relationship_end_date' => $params['end_date'] ?? NULL,
];
if (array_key_exists('custom', $params) && is_array($params['custom'])) {
$this->_caseDetails = [
'case_type' => $caseType,
- 'case_status' => CRM_Utils_Array::value($values['case_status_id'], $statuses),
- 'case_subject' => CRM_Utils_Array::value('subject', $values),
+ 'case_status' => $statuses[$values['case_status_id']] ?? NULL,
+ 'case_subject' => $values['subject'] ?? NULL,
'case_start_date' => $values['case_start_date'],
];
$this->_caseType = $caseTypeName;
'is_active' => 1,
'case_id' => $params['caseID'],
'start_date' => date("Ymd"),
- 'end_date' => CRM_Utils_Array::value('relationship_end_date', $params),
+ 'end_date' => $params['relationship_end_date'] ?? NULL,
];
if (substr($relationshipType, -4) == '_b_a') {
'subject' => !empty($params['subject']) ? $params['subject'] : $activityTypeName,
'status_id' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_status_id', $statusName),
'target_contact_id' => $client,
- 'medium_id' => CRM_Utils_Array::value('medium_id', $params),
- 'location' => CRM_Utils_Array::value('location', $params),
- 'details' => CRM_Utils_Array::value('details', $params),
- 'duration' => CRM_Utils_Array::value('duration', $params),
+ 'medium_id' => $params['medium_id'] ?? NULL,
+ 'location' => $params['location'] ?? NULL,
+ 'details' => $params['details'] ?? NULL,
+ 'duration' => $params['duration'] ?? NULL,
'weight' => $orderVal,
];
}
'entity_id' => $contact->id,
'entity_table' => 'civicrm_contact',
'note' => $note['note'],
- 'subject' => CRM_Utils_Array::value('subject', $note),
+ 'subject' => $note['subject'] ?? NULL,
'contact_id' => $contactId,
];
CRM_Core_BAO_Note::add($noteParams);
'entity_id' => $contact->id,
'entity_table' => 'civicrm_contact',
'note' => $params['note'],
- 'subject' => CRM_Utils_Array::value('subject', $params),
+ 'subject' => $params['subject'] ?? NULL,
'contact_id' => $contactId,
];
CRM_Core_BAO_Note::add($noteParams);
//lookup value of email/postal greeting, addressee, CRM-4575
foreach (self::$_greetingTypes as $greeting) {
$filterCondition = [
- 'contact_type' => CRM_Utils_Array::value('contact_type', $defaults),
+ 'contact_type' => $defaults['contact_type'] ?? NULL,
'greeting_type' => $greeting,
];
CRM_Utils_Array::lookupValue($defaults, $greeting,
$contextMenu['primaryActions'][$key] = [
'title' => $values['title'],
'ref' => $values['ref'],
- 'class' => CRM_Utils_Array::value('class', $values),
+ 'class' => $values['class'] ?? NULL,
'key' => $values['key'],
];
continue;
$contextMenu['moreActions'][$values['weight']] = [
'title' => $values['title'],
'ref' => $values['ref'],
- 'href' => CRM_Utils_Array::value('href', $values),
- 'tab' => CRM_Utils_Array::value('tab', $values),
- 'class' => CRM_Utils_Array::value('class', $values),
+ 'href' => $values['href'] ?? NULL,
+ 'tab' => $values['tab'] ?? NULL,
+ 'class' => $values['class'] ?? NULL,
'key' => $values['key'],
];
}
$contextMenu['otherActions'][$value['weight']] = [
'title' => $value['title'],
'ref' => $value['ref'],
- 'href' => CRM_Utils_Array::value('href', $value),
- 'tab' => CRM_Utils_Array::value('tab', $value),
- 'class' => CRM_Utils_Array::value('class', $value),
- 'icon' => CRM_Utils_Array::value('icon', $value),
+ 'href' => $value['href'] ?? NULL,
+ 'tab' => $value['tab'] ?? NULL,
+ 'class' => $value['class'] ?? NULL,
+ 'icon' => $value['icon'] ?? NULL,
'key' => $value['key'],
];
}
'title' => "Hidden Smart Group {$ssId}",
'is_active' => CRM_Utils_Array::value('is_active', $params, 1),
'is_hidden' => CRM_Utils_Array::value('is_hidden', $params, 1),
- 'group_type' => CRM_Utils_Array::value('group_type', $params),
- 'visibility' => CRM_Utils_Array::value('visibility', $params),
+ 'group_type' => $params['group_type'] ?? NULL,
+ 'visibility' => $params['visibility'] ?? NULL,
'saved_search_id' => $ssId,
];
if (isset($params['contact_id'])) {
// process membership status for deceased contact
$deceasedParams = [
- 'contact_id' => CRM_Utils_Array::value('contact_id', $params),
+ 'contact_id' => $params['contact_id'] ?? NULL,
'is_deceased' => CRM_Utils_Array::value('is_deceased', $params, FALSE),
'deceased_date' => CRM_Utils_Array::value('deceased_date', $params, NULL),
];
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);
'qs' => $qs,
'title' => $value['title'],
'ref' => $value['ref'],
- 'class' => CRM_Utils_Array::value('class', $value),
+ 'class' => $value['class'] ?? NULL,
];
}
}
'contact_id' => $params['prevContribution']->contact_id,
'currency' => $currency,
'amount' => self::getFinancialItemAmountFromParams($inputParams, $context, $lineItemDetails, $isARefund, $previousLineItemTotal),
- 'description' => CRM_Utils_Array::value('description', $prevFinancialItem),
+ 'description' => $prevFinancialItem['description'] ?? NULL,
'status_id' => $prevFinancialItem['status_id'],
'financial_account_id' => $financialAccount,
'entity_table' => 'civicrm_line_item',
'to_financial_account_id' => $params['to_financial_account_id'],
'trxn_date' => !empty($params['contribution']->receive_date) ? $params['contribution']->receive_date : date('YmdHis'),
'total_amount' => $totalAmount,
- 'fee_amount' => CRM_Utils_Array::value('fee_amount', $params),
+ 'fee_amount' => $params['fee_amount'] ?? NULL,
'net_amount' => CRM_Utils_Array::value('net_amount', $params, $totalAmount),
'currency' => $params['contribution']->currency,
'trxn_id' => $params['contribution']->trxn_id,
// this should really default to completed (after discussion).
'status_id' => $statusId,
'payment_instrument_id' => CRM_Utils_Array::value('payment_instrument_id', $params, $params['contribution']->payment_instrument_id),
- 'check_number' => CRM_Utils_Array::value('check_number', $params),
- 'pan_truncation' => CRM_Utils_Array::value('pan_truncation', $params),
- 'card_type_id' => CRM_Utils_Array::value('card_type_id', $params),
+ 'check_number' => $params['check_number'] ?? NULL,
+ 'pan_truncation' => $params['pan_truncation'] ?? NULL,
+ 'card_type_id' => $params['card_type_id'] ?? NULL,
];
if ($contributionStatus == 'Refunded' || $contributionStatus == 'Chargeback' || $contributionStatus == 'Cancelled') {
$trxnParams['trxn_date'] = !empty($params['contribution']->cancel_date) ? $params['contribution']->cancel_date : date('YmdHis');
if ($isPaymentTransaction) {
$contributionParams = [
- 'id' => CRM_Utils_Array::value('contribution_id', $paymentParams),
+ 'id' => $paymentParams['contribution_id'] ?? NULL,
'contact_id' => $contactID,
'is_test' => $isTest,
'source' => CRM_Utils_Array::value('source', $paymentParams, CRM_Utils_Array::value('description', $paymentParams)),
// All of these will be assigned to the template, replacing any that might be assigned elsewhere.
$tplParams = [
'email' => $email,
- 'receiptFromEmail' => CRM_Utils_Array::value('receipt_from_email', $values),
+ 'receiptFromEmail' => $values['receipt_from_email'] ?? NULL,
'contactID' => $contactID,
'displayName' => $displayName,
- 'contributionID' => CRM_Utils_Array::value('contribution_id', $values),
- 'contributionOtherID' => CRM_Utils_Array::value('contribution_other_id', $values),
+ 'contributionID' => $values['contribution_id'] ?? NULL,
+ 'contributionOtherID' => $values['contribution_other_id'] ?? NULL,
// CRM-5095
- 'lineItem' => CRM_Utils_Array::value('lineItem', $values),
+ 'lineItem' => $values['lineItem'] ?? NULL,
// CRM-5095
- 'priceSetID' => CRM_Utils_Array::value('priceSetID', $values),
+ 'priceSetID' => $values['priceSetID'] ?? NULL,
'title' => $title,
- 'isShare' => CRM_Utils_Array::value('is_share', $values),
- 'thankyou_title' => CRM_Utils_Array::value('thankyou_title', $values),
+ 'isShare' => $values['is_share'] ?? NULL,
+ 'thankyou_title' => $values['thankyou_title'] ?? NULL,
'customPre' => $values['customPre'],
'customPre_grouptitle' => $values['customPre_grouptitle'],
'customPost' => $values['customPost'],
'amount' => $values['amount'],
'is_pay_later' => $values['is_pay_later'],
'receipt_date' => !$values['receipt_date'] ? NULL : date('YmdHis', strtotime($values['receipt_date'])),
- 'pay_later_receipt' => CRM_Utils_Array::value('pay_later_receipt', $values),
- 'honor_block_is_active' => CRM_Utils_Array::value('honor_block_is_active', $values),
- 'contributionStatus' => CRM_Utils_Array::value('contribution_status', $values),
+ 'pay_later_receipt' => $values['pay_later_receipt'] ?? NULL,
+ 'honor_block_is_active' => $values['honor_block_is_active'] ?? NULL,
+ 'contributionStatus' => $values['contribution_status'] ?? NULL,
];
if ($contributionTypeId = CRM_Utils_Array::value('financial_type_id', $values)) {
}
$activityParams = [
'subject' => !empty($params['membership_id']) ? ts('Auto-renewal membership cancelled') : ts('Recurring contribution cancelled'),
- 'details' => CRM_Utils_Array::value('processor_message', $params),
+ 'details' => $params['processor_message'] ?? NULL,
];
$cancelledId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_ContributionRecur', 'contribution_status_id', 'Cancelled');
//CRM-11106
if ($premiumID == NULL || $isDeleted) {
$premiumParams = [
- 'cost' => CRM_Utils_Array::value('cost', $productDetails),
- 'currency' => CRM_Utils_Array::value('currency', $productDetails),
- 'financial_type_id' => CRM_Utils_Array::value('financial_type_id', $productDetails),
+ 'cost' => $productDetails['cost'] ?? NULL,
+ 'currency' => $productDetails['currency'] ?? NULL,
+ 'financial_type_id' => $productDetails['financial_type_id'] ?? NULL,
'contributionId' => $contributionID,
];
if ($isDeleted) {
$this->set('is_deductible', TRUE);
}
$contributionParams = [
- 'id' => CRM_Utils_Array::value('contribution_id', $this->_params),
+ 'id' => $this->_params['contribution_id'] ?? NULL,
'contact_id' => $contactID,
'line_item' => $lineItem,
'is_test' => $isTest,
- 'campaign_id' => CRM_Utils_Array::value('campaign_id', $this->_params),
- 'contribution_page_id' => CRM_Utils_Array::value('contribution_page_id', $this->_params),
+ 'campaign_id' => $this->_params['campaign_id'] ?? NULL,
+ 'contribution_page_id' => $this->_params['contribution_page_id'] ?? NULL,
'source' => CRM_Utils_Array::value('source', $paymentParams, CRM_Utils_Array::value('description', $paymentParams)),
- 'thankyou_date' => CRM_Utils_Array::value('thankyou_date', $this->_params),
+ 'thankyou_date' => $this->_params['thankyou_date'] ?? NULL,
];
$contributionParams['payment_instrument_id'] = $this->_paymentProcessor['payment_instrument_id'];
'trxn_id' => $result['trxn_id'],
'payment_processor_id' => $this->_paymentProcessor['id'],
'is_transactional' => FALSE,
- 'fee_amount' => CRM_Utils_Array::value('fee_amount', $result),
- 'card_type_id' => CRM_Utils_Array::value('card_type_id', $paymentParams),
- 'pan_truncation' => CRM_Utils_Array::value('pan_truncation', $paymentParams),
+ 'fee_amount' => $result['fee_amount'] ?? NULL,
+ 'card_type_id' => $paymentParams['card_type_id'] ?? NULL,
+ 'pan_truncation' => $paymentParams['pan_truncation'] ?? NULL,
'is_email_receipt' => FALSE,
]);
// This has now been set to 1 in the DB - declare it here also
$contributionParams = [
'financial_type_id' => $financialTypeID,
'receive_date' => (CRM_Utils_Array::value('receive_date', $params)) ? CRM_Utils_Date::processDate($params['receive_date']) : date('YmdHis'),
- 'tax_amount' => CRM_Utils_Array::value('tax_amount', $params),
- 'amount_level' => CRM_Utils_Array::value('amount_level', $params),
+ 'tax_amount' => $params['tax_amount'] ?? NULL,
+ 'amount_level' => $params['amount_level'] ?? NULL,
'invoice_id' => $params['invoiceID'],
'currency' => $params['currencyID'],
'is_pay_later' => CRM_Utils_Array::value('is_pay_later', $params, 0),
$params = [
'product_id' => $premiumParams['selectProduct'],
'contribution_id' => $contribution->id,
- 'product_option' => CRM_Utils_Array::value('options_' . $premiumParams['selectProduct'], $premiumParams),
+ 'product_option' => $premiumParams['options_' . $premiumParams['selectProduct']] ?? NULL,
'quantity' => 1,
'start_date' => CRM_Utils_Date::customFormat($startDate, '%Y%m%d'),
'end_date' => CRM_Utils_Date::customFormat($endDate, '%Y%m%d'),
try {
civicrm_api3('contribution', 'completetransaction', [
'id' => $contributionID,
- 'trxn_id' => CRM_Utils_Array::value('trxn_id', $result),
+ 'trxn_id' => $result['trxn_id'] ?? NULL,
'payment_processor_id' => CRM_Utils_Array::value('payment_processor_id', $result, $this->_paymentProcessor['id']),
'is_transactional' => FALSE,
- 'fee_amount' => CRM_Utils_Array::value('fee_amount', $result),
- 'receive_date' => CRM_Utils_Array::value('receive_date', $result),
- 'card_type_id' => CRM_Utils_Array::value('card_type_id', $result),
- 'pan_truncation' => CRM_Utils_Array::value('pan_truncation', $result),
+ 'fee_amount' => $result['fee_amount'] ?? NULL,
+ 'receive_date' => $result['receive_date'] ?? NULL,
+ 'card_type_id' => $result['card_type_id'] ?? NULL,
+ 'pan_truncation' => $result['pan_truncation'] ?? NULL,
]);
}
catch (CiviCRM_API3_Exception $e) {
try {
// A payment notification update could have come in at any time. Check at the last minute.
$contributionStatusID = civicrm_api3('Contribution', 'getvalue', [
- 'id' => CRM_Utils_Array::value('contributionID', $params),
+ 'id' => $params['contributionID'] ?? NULL,
'return' => 'contribution_status_id',
'is_test' => ($this->_mode == 'test') ? 1 : 0,
- 'invoice_id' => CRM_Utils_Array::value('invoiceID', $params),
+ 'invoice_id' => $params['invoiceID'] ?? NULL,
]);
if (CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $contributionStatusID) === 'Pending'
&& !empty($params['payment_processor_id'])
'label' => ts('Other Amount'),
'price_set_id' => $priceSetId,
'html_type' => 'Text',
- 'financial_type_id' => CRM_Utils_Array::value('financial_type_id', $this->_values),
+ 'financial_type_id' => $this->_values['financial_type_id'] ?? NULL,
'is_display_amounts' => 0,
'weight' => 3,
];
'amountPaid' => $amountPaid,
'invoice_date' => $invoiceDate,
'dueDate' => $dueDate,
- 'notes' => CRM_Utils_Array::value('notes', $prefixValue),
+ 'notes' => $prefixValue['notes'] ?? NULL,
'display_name' => $contribution->_relatedObjects['contact']->display_name,
'lineItem' => $lineItem,
'dataArray' => $dataArray,
'contribution_status_id' => $contribution->contribution_status_id,
'contributionStatusName' => CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $contribution->contribution_status_id),
'subTotal' => $subTotal,
- 'street_address' => CRM_Utils_Array::value('street_address', $billingAddress),
- 'supplemental_address_1' => CRM_Utils_Array::value('supplemental_address_1', $billingAddress),
- 'supplemental_address_2' => CRM_Utils_Array::value('supplemental_address_2', $billingAddress),
- 'supplemental_address_3' => CRM_Utils_Array::value('supplemental_address_3', $billingAddress),
- 'city' => CRM_Utils_Array::value('city', $billingAddress),
- 'postal_code' => CRM_Utils_Array::value('postal_code', $billingAddress),
- 'state_province' => CRM_Utils_Array::value('state_province', $billingAddress),
- 'state_province_abbreviation' => CRM_Utils_Array::value('state_province_abbreviation', $billingAddress),
+ 'street_address' => $billingAddress['street_address'] ?? NULL,
+ 'supplemental_address_1' => $billingAddress['supplemental_address_1'] ?? NULL,
+ 'supplemental_address_2' => $billingAddress['supplemental_address_2'] ?? NULL,
+ 'supplemental_address_3' => $billingAddress['supplemental_address_3'] ?? NULL,
+ 'city' => $billingAddress['city'] ?? NULL,
+ 'postal_code' => $billingAddress['postal_code'] ?? NULL,
+ 'state_province' => $billingAddress['state_province'] ?? NULL,
+ 'state_province_abbreviation' => $billingAddress['state_province_abbreviation'] ?? NULL,
// Kept for backwards compatibility
- 'stateProvinceAbbreviation' => CRM_Utils_Array::value('state_province_abbreviation', $billingAddress),
- 'country' => CRM_Utils_Array::value('country', $billingAddress),
+ 'stateProvinceAbbreviation' => $billingAddress['state_province_abbreviation'] ?? NULL,
+ 'country' => $billingAddress['country'] ?? NULL,
'is_pay_later' => $contribution->is_pay_later,
'organization_name' => $contribution->_relatedObjects['contact']->organization_name,
'domain_organization' => $domain->name,
if (!empty($formValues['email_options'])) {
$returnProperties['email'] = $returnProperties['on_hold'] = $returnProperties['is_deceased'] = $returnProperties['do_not_email'] = 1;
$emailParams = [
- 'subject' => CRM_Utils_Array::value('subject', $formValues),
- 'from' => CRM_Utils_Array::value('from_email_address', $formValues),
+ 'subject' => $formValues['subject'] ?? NULL,
+ 'from' => $formValues['from_email_address'] ?? NULL,
];
$emailParams['from'] = CRM_Utils_Mail::formatFromAddress($emailParams['from']);
// onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE
if (!empty($paramValues['invoice_id']) || !empty($paramValues['trxn_id']) || !empty($paramValues['contribution_id'])) {
$dupeIds = [
- 'id' => CRM_Utils_Array::value('contribution_id', $paramValues),
- 'trxn_id' => CRM_Utils_Array::value('trxn_id', $paramValues),
- 'invoice_id' => CRM_Utils_Array::value('invoice_id', $paramValues),
+ 'id' => $paramValues['contribution_id'] ?? NULL,
+ 'trxn_id' => $paramValues['trxn_id'] ?? NULL,
+ 'invoice_id' => $paramValues['invoice_id'] ?? NULL,
];
$ids['contribution'] = CRM_Contribute_BAO_Contribution::checkDuplicateIds($dupeIds);
}
$contactFields = [
'contact_id' => $contactId,
- 'location_type_id' => CRM_Utils_Array::value('location_type_id', $value),
+ 'location_type_id' => $value['location_type_id'] ?? NULL,
];
$contactFields['is_primary'] = 0;
$details[$groupID][$values['id']]['collapse_adv_display'] = CRM_Utils_Array::value('collapse_adv_display', $group);
$details[$groupID][$values['id']]['style'] = CRM_Utils_Array::value('style', $group);
$details[$groupID][$values['id']]['fields'][$k] = [
- 'field_title' => CRM_Utils_Array::value('label', $properties),
- 'field_type' => CRM_Utils_Array::value('html_type', $properties),
- 'field_data_type' => CRM_Utils_Array::value('data_type', $properties),
+ 'field_title' => $properties['label'] ?? NULL,
+ 'field_type' => $properties['html_type'] ?? NULL,
+ 'field_data_type' => $properties['data_type'] ?? NULL,
'field_value' => CRM_Core_BAO_CustomField::displayValue($values['data'], $properties['id'], $entityId),
- 'options_per_line' => CRM_Utils_Array::value('options_per_line', $properties),
+ 'options_per_line' => $properties['options_per_line'] ?? NULL,
];
// editable = whether this set contains any non-read-only fields
if (!isset($details[$groupID][$values['id']]['editable'])) {
'custom_group_id' => $customValue['custom_group_id'],
'table_name' => $customValue['table_name'],
'column_name' => $customValue['column_name'],
- 'is_multiple' => CRM_Utils_Array::value('is_multiple', $customValue),
+ 'is_multiple' => $customValue['is_multiple'] ?? NULL,
'file_id' => $customValue['file_id'],
];
'label' => $item['dashboard_id.label'],
'url' => $item['dashboard_id.url'],
'cache_minutes' => $item['dashboard_id.cache_minutes'],
- 'fullscreen_url' => CRM_Utils_Array::value('dashboard_id.fullscreen_url', $item),
+ 'fullscreen_url' => $item['dashboard_id.fullscreen_url'] ?? NULL,
];
}
}
'label' => $dashlet['label'],
'cache_minutes' => $dashlet['cache_minutes'],
'url' => $dashlet['url'],
- 'fullscreen_url' => CRM_Utils_Array::value('fullscreen_url', $dashlet),
+ 'fullscreen_url' => $dashlet['fullscreen_url'] ?? NULL,
];
}
}
'to_financial_account_id' => CRM_Contribute_PseudoConstant::getRelationalFinancialAccount($params['financial_type_id'], $toFinancialAccountType),
'from_financial_account_id' => CRM_Contribute_PseudoConstant::getRelationalFinancialAccount($params['financial_type_id'], $fromFinancialAccountType),
'trxn_date' => date('YmdHis'),
- 'total_amount' => !empty($params['cost']) ? $params['cost'] : 0,
- 'currency' => CRM_Utils_Array::value('currency', $params),
+ 'total_amount' => $params['cost'] ?? 0,
+ 'currency' => $params['currency'] ?? NULL,
'status_id' => array_search('Completed', $contributionStatuses),
'entity_table' => 'civicrm_contribution',
'entity_id' => $params['contributionId'],
$productDetails = [];
CRM_Contribute_BAO_Product::retrieve($premiumParams, $productDetails);
$params = [
- 'cost' => CRM_Utils_Array::value('cost', $productDetails),
- 'currency' => CRM_Utils_Array::value('currency', $productDetails),
- 'financial_type_id' => CRM_Utils_Array::value('financial_type_id', $productDetails),
+ 'cost' => $productDetails['cost'] ?? NULL,
+ 'currency' => $productDetails['currency'] ?? NULL,
+ 'financial_type_id' => $productDetails['financial_type_id'] ?? NULL,
'contributionId' => $params['oldPremium']['contribution_id'],
'isDeleted' => TRUE,
];
$allTags[$id] = [
'text' => $tag['name'],
'id' => $id,
- 'description' => CRM_Utils_Array::value('description', $tag),
- 'parent_id' => CRM_Utils_Array::value('parent_id', $tag),
- 'used_for' => CRM_Utils_Array::value('used_for', $tag),
- 'color' => CRM_Utils_Array::value('color', $tag),
+ 'description' => $tag['description'] ?? NULL,
+ 'parent_id' => $tag['parent_id'] ?? NULL,
+ 'used_for' => $tag['used_for'] ?? NULL,
+ 'color' => $tag['color'] ?? NULL,
];
if (!$allowSelectingNonSelectable && empty($tag['is_selectable'])) {
$allTags[$id]['disabled'] = TRUE;
),
'skipDisplay' => 0,
'data_type' => CRM_Utils_Type::getDataTypeFromFieldMetadata($fieldMetaData),
- 'bao' => CRM_Utils_Array::value('bao', $fieldMetaData),
+ 'bao' => $fieldMetaData['bao'] ?? NULL,
];
$formattedField = CRM_Utils_Date::addDateMetadataToField($fieldMetaData, $formattedField);
$value = array(
'title' => $item['title'],
- 'desc' => CRM_Utils_Array::value('desc', $item),
+ 'desc' => $item['desc'] ?? NULL,
'id' => strtr($item['title'], array(
'(' => '_',
')' => '',
// forceBackend; CRM-14439 work-around; acceptable for now because we don't display breadcrumbs on frontend
TRUE
),
- 'icon' => CRM_Utils_Array::value('icon', $item),
- 'extra' => CRM_Utils_Array::value('extra', $item),
+ 'icon' => $item['icon'] ?? NULL,
+ 'extra' => $item['extra'] ?? NULL,
);
if (!array_key_exists($item['adminGroup'], $values)) {
$values[$item['adminGroup']] = array();
't3' => ucfirst(substr($params['frequency_unit'], 0, 1)),
'src' => 1,
'sra' => 1,
- 'srt' => CRM_Utils_Array::value('installments', $params),
+ 'srt' => $params['installments'] ?? NULL,
'no_note' => 1,
'modify' => 0,
];
// Merge params with schema defaults
$params += [
'condition' => CRM_Utils_Array::value('condition', $pseudoconstant, []),
- 'keyColumn' => CRM_Utils_Array::value('keyColumn', $pseudoconstant),
- 'labelColumn' => CRM_Utils_Array::value('labelColumn', $pseudoconstant),
+ 'keyColumn' => $pseudoconstant['keyColumn'] ?? NULL,
+ 'labelColumn' => $pseudoconstant['labelColumn'] ?? NULL,
];
// Fetch option group from option_value table
$regexp = preg_replace('/[.,;:!?]/', '', CRM_Utils_Array::value(0, $values));
$importableFields[$key] = [
'name' => $key,
- 'title' => CRM_Utils_Array::value('label', $values),
+ 'title' => $values['label'] ?? NULL,
'headerPattern' => '/' . preg_quote($regexp, '/') . '/',
'import' => 1,
'custom_field_id' => $id,
- 'options_per_line' => CRM_Utils_Array::value('options_per_line', $values),
- 'data_type' => CRM_Utils_Array::value('data_type', $values),
- 'html_type' => CRM_Utils_Array::value('html_type', $values),
- 'is_search_range' => CRM_Utils_Array::value('is_search_range', $values),
+ 'options_per_line' => $values['options_per_line'] ?? NULL,
+ 'data_type' => $values['data_type'] ?? NULL,
+ 'html_type' => $values['html_type'] ?? NULL,
+ 'is_search_range' => $values['is_search_range'] ?? NULL,
];
if (CRM_Utils_Array::value('html_type', $values) == 'Select Date') {
$importableFields[$key]['date_format'] = CRM_Utils_Array::value('date_format', $values);
}
$tplParams = array_merge($values, $participantParams, [
'email' => $email,
- 'confirm_email_text' => CRM_Utils_Array::value('confirm_email_text', $values['event']),
- 'isShowLocation' => CRM_Utils_Array::value('is_show_location', $values['event']),
+ 'confirm_email_text' => $values['event']['confirm_email_text'] ?? NULL,
+ 'isShowLocation' => $values['event']['is_show_location'] ?? NULL,
// The concept of contributeMode is deprecated.
- 'contributeMode' => CRM_Utils_Array::value('contributeMode', $template->_tpl_vars),
+ 'contributeMode' => $template->_tpl_vars['contributeMode'] ?? NULL,
'customPre' => $profilePre[0],
'customPre_grouptitle' => empty($profilePre[1]) ? NULL : [CRM_Core_BAO_UFGroup::getFrontEndTitle((int) $preProfileID)],
'customPost' => $profilePost[0],
$fromEmailValues['from_email_id'][$eventEmailId] = htmlspecialchars($eventEmailId);
$fromEmailId = [
- 'cc' => CRM_Utils_Array::value('cc_confirm', $eventEmail),
- 'bcc' => CRM_Utils_Array::value('bcc_confirm', $eventEmail),
+ 'cc' => $eventEmail['cc_confirm'] ?? NULL,
+ 'bcc' => $eventEmail['bcc_confirm'] ?? NULL,
];
$fromEmailValues = array_merge($fromEmailValues, $fromEmailId);
}
'domain' => $domainValues,
'participant' => $participantValues,
'event' => $eventDetails,
- 'paidEvent' => CRM_Utils_Array::value('is_monetary', $eventDetails),
- 'isShowLocation' => CRM_Utils_Array::value('is_show_location', $eventDetails),
+ 'paidEvent' => $eventDetails['is_monetary'] ?? NULL,
+ 'isShowLocation' => $eventDetails['is_show_location'] ?? NULL,
'isAdditional' => $participantValues['registered_by_id'],
'isExpired' => $mailType == 'Expired',
'isConfirm' => $mailType == 'Confirm',
'from' => $receiptFrom,
'toName' => $participantName,
'toEmail' => $toEmail,
- 'cc' => CRM_Utils_Array::value('cc_confirm', $eventDetails),
- 'bcc' => CRM_Utils_Array::value('bcc_confirm', $eventDetails),
+ 'cc' => $eventDetails['cc_confirm'] ?? NULL,
+ 'bcc' => $eventDetails['bcc_confirm'] ?? NULL,
]
);
*/
public static function create(&$params) {
$participantParams = [
- 'id' => CRM_Utils_Array::value('id', $params),
+ 'id' => $params['id'] ?? NULL,
'role_id' => self::get_attendee_role_id(),
'status_id' => self::get_pending_in_cart_status_id(),
'contact_id' => $params['contact_id'],
'source' => CRM_Utils_Array::value('participant_source', $params, $this->description),
'is_pay_later' => $this->is_pay_later,
'fee_amount' => CRM_Utils_Array::value('amount', $params, 0),
- 'fee_currency' => CRM_Utils_Array::value('currencyID', $params),
+ 'fee_currency' => $params['currencyID'] ?? NULL,
];
if ($participant->must_wait) {
$trxnDetails = [
'trxn_id' => $result['trxn_id'],
'trxn_date' => $result['now'],
- 'currency' => CRM_Utils_Array::value('currencyID', $result),
+ 'currency' => $result['currencyID'] ?? NULL,
];
return $trxnDetails;
}
'net_amount' => $params['amount'],
'invoice_id' => "{$params['invoiceID']}-{$this->sub_trxn_index}",
'trxn_id' => "{$params['trxn_id']}-{$this->sub_trxn_index}",
- 'currency' => CRM_Utils_Array::value('currencyID', $params),
+ 'currency' => $params['currencyID'] ?? NULL,
'source' => $event->title,
'is_pay_later' => CRM_Utils_Array::value('is_pay_later', $params, 0),
'contribution_status_id' => $params['contribution_status_id'],
'payment_instrument_id' => $params['payment_instrument_id'],
- 'check_number' => CRM_Utils_Array::value('check_number', $params),
+ 'check_number' => $params['check_number'] ?? NULL,
'skipLineItem' => 1,
];
'currency' => $params['currencyID'],
'source' => !empty($params['participant_source']) ? $params['participant_source'] : $params['description'],
'is_pay_later' => CRM_Utils_Array::value('is_pay_later', $params, 0),
- 'campaign_id' => CRM_Utils_Array::value('campaign_id', $params),
- 'card_type_id' => CRM_Utils_Array::value('card_type_id', $params),
- 'pan_truncation' => CRM_Utils_Array::value('pan_truncation', $params),
+ 'campaign_id' => $params['campaign_id'] ?? NULL,
+ 'card_type_id' => $params['card_type_id'] ?? NULL,
+ 'pan_truncation' => $params['pan_truncation'] ?? NULL,
];
if ($paymentProcessor) {
if (!$pending && $result) {
$contribParams += [
- 'fee_amount' => CRM_Utils_Array::value('fee_amount', $result),
+ 'fee_amount' => $result['fee_amount'] ?? NULL,
'trxn_id' => $result['trxn_id'],
'receipt_date' => $receiptDate,
];
$participantFields = CRM_Event_DAO_Participant::fields();
$participantParams = [
- 'id' => CRM_Utils_Array::value('participant_id', $params),
+ 'id' => $params['participant_id'] ?? NULL,
'contact_id' => $contactID,
'event_id' => $form->_eventId ? $form->_eventId : $params['event_id'],
'status_id' => CRM_Utils_Array::value('participant_status',
isset($params['participant_source']) ? CRM_Utils_Array::value('participant_source', $params) : CRM_Utils_Array::value('description', $params),
$participantFields['participant_source']['maxlength']
),
- 'fee_level' => CRM_Utils_Array::value('amount_level', $params),
+ 'fee_level' => $params['amount_level'] ?? NULL,
'is_pay_later' => CRM_Utils_Array::value('is_pay_later', $params, 0),
- 'fee_amount' => CRM_Utils_Array::value('fee_amount', $params),
- 'registered_by_id' => CRM_Utils_Array::value('registered_by_id', $params),
- 'discount_id' => CRM_Utils_Array::value('discount_id', $params),
- 'fee_currency' => CRM_Utils_Array::value('currencyID', $params),
- 'campaign_id' => CRM_Utils_Array::value('campaign_id', $params),
+ 'fee_amount' => $params['fee_amount'] ?? NULL,
+ 'registered_by_id' => $params['registered_by_id'] ?? NULL,
+ 'discount_id' => $params['discount_id'] ?? NULL,
+ 'fee_currency' => $params['currencyID'] ?? NULL,
+ 'campaign_id' => $params['campaign_id'] ?? NULL,
];
if ($form->_action & CRM_Core_Action::PREVIEW || CRM_Utils_Array::value('mode', $params) == 'test') {
$participantFields = CRM_Event_DAO_Participant::fields();
$participantParams = array(
- 'id' => CRM_Utils_Array::value('participant_id', $params),
+ 'id' => $params['participant_id'] ?? NULL,
'contact_id' => $contactID,
'event_id' => $form->_eventId ? $form->_eventId : $params['event_id'],
'status_id' => CRM_Utils_Array::value('participant_status',
isset($params['participant_source']) ? CRM_Utils_Array::value('participant_source', $params) : CRM_Utils_Array::value('description', $params),
$participantFields['participant_source']['maxlength']
),
- 'fee_level' => CRM_Utils_Array::value('amount_level', $params),
+ 'fee_level' => $params['amount_level'] ?? NULL,
'is_pay_later' => CRM_Utils_Array::value('is_pay_later', $params, 0),
- 'fee_amount' => CRM_Utils_Array::value('fee_amount', $params),
- 'registered_by_id' => CRM_Utils_Array::value('registered_by_id', $params),
- 'discount_id' => CRM_Utils_Array::value('discount_id', $params),
- 'fee_currency' => CRM_Utils_Array::value('currencyID', $params),
- 'campaign_id' => CRM_Utils_Array::value('campaign_id', $params),
+ 'fee_amount' => $params['fee_amount'] ?? NULL,
+ 'registered_by_id' => $params['registered_by_id'] ?? NULL,
+ 'discount_id' => $params['discount_id'] ?? NULL,
+ 'fee_currency' => $params['currencyID'] ?? NULL,
+ 'campaign_id' => $params['campaign_id'] ?? NULL,
);
if ($form->_action & CRM_Core_Action::PREVIEW || CRM_Utils_Array::value('mode', $params) == 'test') {
'currency' => $params['currencyID'],
'source' => !empty($params['participant_source']) ? $params['participant_source'] : $params['description'],
'is_pay_later' => CRM_Utils_Array::value('is_pay_later', $params, 0),
- 'campaign_id' => CRM_Utils_Array::value('campaign_id', $params),
- 'card_type_id' => CRM_Utils_Array::value('card_type_id', $params),
- 'pan_truncation' => CRM_Utils_Array::value('pan_truncation', $params),
+ 'campaign_id' => $params['campaign_id'] ?? NULL,
+ 'card_type_id' => $params['card_type_id'] ?? NULL,
+ 'pan_truncation' => $params['pan_truncation'] ?? NULL,
];
if ($paymentProcessor) {
if (!$pending && $result) {
$contribParams += [
- 'fee_amount' => CRM_Utils_Array::value('fee_amount', $result),
+ 'fee_amount' => $result['fee_amount'] ?? NULL,
'trxn_id' => $result['trxn_id'],
'receipt_date' => $receiptDate,
];
'from' => $receiptFrom,
'toName' => $participantName,
'toEmail' => $toEmail,
- 'cc' => CRM_Utils_Array::value('cc_confirm', $eventDetails),
- 'bcc' => CRM_Utils_Array::value('bcc_confirm', $eventDetails),
+ 'cc' => $eventDetails['cc_confirm'] ?? NULL,
+ 'bcc' => $eventDetails['bcc_confirm'] ?? NULL,
];
CRM_Core_BAO_MessageTemplate::sendTemplate($sendTemplateParams);
}
$session = CRM_Core_Session::singleton();
$params = [
'contact_id' => $session->get('userID'),
- 'event_id' => CRM_Utils_Array::value('id', $values['event']),
- 'role_id' => CRM_Utils_Array::value('default_role_id', $values['event']),
+ 'event_id' => $values['event']['id'] ?? NULL,
+ 'role_id' => $values['event']['default_role_id'] ?? NULL,
];
if ($eventFullMessage && ($noFullMsg == 'false') || CRM_Event_BAO_Event::checkRegistration($params)) {
'amountOwed' => $entities['payment']['balance'],
'totalPaid' => $entities['payment']['paid'],
'paymentAmount' => $entities['payment']['total_amount'],
- 'checkNumber' => CRM_Utils_Array::value('check_number', $entities['payment']),
+ 'checkNumber' => $entities['payment']['check_number'] ?? NULL,
'receive_date' => $entities['payment']['trxn_date'],
'paidBy' => CRM_Core_PseudoConstant::getLabel('CRM_Core_BAO_FinancialTrxn', 'payment_instrument_id', $entities['payment']['payment_instrument_id']),
'isShowLocation' => (!empty($entities['event']) ? $entities['event']['is_show_location'] : FALSE),
- 'location' => CRM_Utils_Array::value('location', $entities),
- 'event' => CRM_Utils_Array::value('event', $entities),
+ 'location' => $entities['location'] ?? NULL,
+ 'event' => $entities['event'] ?? NULL,
'component' => (!empty($entities['event']) ? 'event' : 'contribution'),
'isRefund' => $entities['payment']['total_amount'] < 0,
'isAmountzero' => $entities['payment']['total_amount'] === 0,
$params = [
'id' => $this->_id,
'payment_instrument_id' => $this->_submitValues['payment_instrument_id'],
- 'trxn_id' => CRM_Utils_Array::value('trxn_id', $this->_submitValues),
+ 'trxn_id' => $this->_submitValues['trxn_id'] ?? NULL,
'trxn_date' => CRM_Utils_Array::value('trxn_date', $this->_submitValues, date('YmdHis')),
];
'details' => $params['suggested_message'],
'status_id' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_status_id', 'Completed'),
'is_test' => $params['is_test'],
- 'campaign_id' => CRM_Utils_Array::value('campaign_id', $params),
+ 'campaign_id' => $params['campaign_id'] ?? NULL,
];
// activity creation
'action' => $changed['log_action'],
'id' => $id,
'field' => $diff,
- 'from' => CRM_Utils_Array::value($diff, $original),
- 'to' => CRM_Utils_Array::value($diff, $changed),
+ 'from' => $original[$diff] ?? NULL,
+ 'to' => $changed[$diff] ?? NULL,
'table' => $table,
'log_date' => $changed['log_date'],
'log_conn_id' => $changed['log_conn_id'],
'price_sets' => $priceSets,
'fields' => $fields,
'price_fields' => [
- 'price_' . $fieldID => CRM_Utils_Array::value('id', $results),
+ 'price_' . $fieldID => $results['id'] ?? NULL,
],
];
return $returnParams;
// - set the payment information block
// - set the max related block
$allMembershipInfo[$key] = [
- 'financial_type_id' => CRM_Utils_Array::value('financial_type_id', $values),
+ 'financial_type_id' => $values['financial_type_id'] ?? NULL,
'total_amount' => CRM_Utils_Money::format($totalAmount, NULL, '%a'),
'total_amount_numeric' => $totalAmount,
- 'auto_renew' => CRM_Utils_Array::value('auto_renew', $values),
+ 'auto_renew' => $values['auto_renew'] ?? NULL,
'has_related' => isset($values['relationship_type_id']),
- 'max_related' => CRM_Utils_Array::value('max_related', $values),
+ 'max_related' => $values['max_related'] ?? NULL,
];
}
'contact_id' => $this->_contributorContactID,
'line_item' => $lineItem,
'is_test' => $isTest,
- 'campaign_id' => CRM_Utils_Array::value('campaign_id', $paymentParams),
- 'contribution_page_id' => CRM_Utils_Array::value('contribution_page_id', $formValues),
+ 'campaign_id' => $paymentParams['campaign_id'] ?? NULL,
+ 'contribution_page_id' => $formValues['contribution_page_id'] ?? NULL,
'source' => CRM_Utils_Array::value('source', $paymentParams, CRM_Utils_Array::value('description', $paymentParams)),
- 'thankyou_date' => CRM_Utils_Array::value('thankyou_date', $paymentParams),
+ 'thankyou_date' => $paymentParams['thankyou_date'] ?? NULL,
'payment_instrument_id' => $paymentInstrumentID,
],
$financialType,
// build membership info array, which is used to set the payment information block when
// membership type is selected.
$allMembershipInfo[$key] = [
- 'financial_type_id' => CRM_Utils_Array::value('financial_type_id', $values),
+ 'financial_type_id' => $values['financial_type_id'] ?? NULL,
'total_amount' => CRM_Utils_Money::format($totalAmount, NULL, '%a'),
'total_amount_numeric' => $totalAmount,
'tax_message' => $taxAmount ? ts("Includes %1 amount of %2", [1 => $this->getSalesTaxTerm(), 2 => CRM_Utils_Money::format($taxAmount)]) : $taxAmount,
'end_date' => CRM_Utils_Date::processDate($owner['end_date'], NULL, TRUE, 'Ymd'),
'source' => ts('Manual Assignment of Related Membership'),
'is_test' => $owner['is_test'],
- 'campaign_id' => CRM_Utils_Array::value('campaign_id', $owner),
+ 'campaign_id' => $owner['campaign_id'] ?? NULL,
'status_id' => $owner['status_id'],
'skipStatusCal' => TRUE,
'createActivity' => TRUE,
$contributionParams, $contributionStatus, $returnProperties
);
$contributionValue = array(
- 'status' => CRM_Utils_Array::value('contribution_status_id', $contributionStatus),
- 'receive_date' => CRM_Utils_Array::value('receive_date', $contributionStatus),
+ 'status' => $contributionStatus['contribution_status_id'] ?? NULL,
+ 'receive_date' => $contributionStatus['receive_date'] ?? NULL,
);
}
$payments[$payID] = array_merge($contributionValue,
array(
- 'amount' => CRM_Utils_Array::value('scheduled_amount', $values),
- 'due_date' => CRM_Utils_Array::value('scheduled_date', $values),
+ 'amount' => $values['scheduled_amount'] ?? NULL,
+ 'due_date' => $values['scheduled_date'] ?? NULL,
)
);
'is_test' => $params['is_test'],
'status_id' => 2,
'details' => $details,
- 'campaign_id' => CRM_Utils_Array::value('campaign_id', $params),
+ 'campaign_id' => $params['campaign_id'] ?? NULL,
);
// lets insert assignee record.
foreach ($overduePayments as $id => $payment) {
$label = ts("%1 - due on %2 (overdue)", array(
1 => CRM_Utils_Money::format(CRM_Utils_Array::value('scheduled_amount', $payment), CRM_Utils_Array::value('scheduled_amount_currency', $payment)),
- 2 => CRM_Utils_Array::value('scheduled_date', $payment),
+ 2 => $payment['scheduled_date'] ?? NULL,
));
$paymentID = CRM_Utils_Array::value('id', $payment);
$payments[] = $form->createElement('checkbox', $paymentID, NULL, $label, array('amount' => CRM_Utils_Array::value('scheduled_amount', $payment)));
if (!empty($nextPayment)) {
$label = ts("%1 - due on %2", array(
1 => CRM_Utils_Money::format(CRM_Utils_Array::value('scheduled_amount', $nextPayment), CRM_Utils_Array::value('scheduled_amount_currency', $nextPayment)),
- 2 => CRM_Utils_Array::value('scheduled_date', $nextPayment),
+ 2 => $nextPayment['scheduled_date'] ?? NULL,
));
$paymentID = CRM_Utils_Array::value('id', $nextPayment);
$payments[] = $form->createElement('checkbox', $paymentID, NULL, $label, array('amount' => CRM_Utils_Array::value('scheduled_amount', $nextPayment)));
$values[$oid] = [
'price_field_id' => $fid,
'price_field_value_id' => $oid,
- 'label' => CRM_Utils_Array::value('label', $options[$oid]),
+ 'label' => $options[$oid]['label'] ?? NULL,
'field_title' => $fieldTitle,
- 'description' => CRM_Utils_Array::value('description', $options[$oid]),
+ 'description' => $options[$oid]['description'] ?? NULL,
'qty' => $qty,
'unit_price' => $price,
'line_total' => $qty * $price,
'participant_count' => $qty * $participantsPerField,
- 'max_value' => CRM_Utils_Array::value('max_value', $options[$oid]),
- 'membership_type_id' => CRM_Utils_Array::value('membership_type_id', $options[$oid]),
- 'membership_num_terms' => CRM_Utils_Array::value('membership_num_terms', $options[$oid]),
- 'auto_renew' => CRM_Utils_Array::value('auto_renew', $options[$oid]),
+ 'max_value' => $options[$oid]['max_value'] ?? NULL,
+ 'membership_type_id' => $options[$oid]['membership_type_id'] ?? NULL,
+ 'membership_num_terms' => $options[$oid]['membership_num_terms'] ?? NULL,
+ 'auto_renew' => $options[$oid]['auto_renew'] ?? NULL,
'html_type' => $fields['html_type'],
- 'financial_type_id' => CRM_Utils_Array::value('financial_type_id', $options[$oid]),
+ 'financial_type_id' => $options[$oid]['financial_type_id'] ?? NULL,
'tax_amount' => CRM_Utils_Array::value('tax_amount', $options[$oid], 0),
- 'non_deductible_amount' => CRM_Utils_Array::value('non_deductible_amount', $options[$oid]),
+ 'non_deductible_amount' => $options[$oid]['non_deductible_amount'] ?? NULL,
];
if ($values[$oid]['membership_type_id'] && empty($values[$oid]['auto_renew'])) {
'is_active' => 1,
'is_default' => !empty($defaultArray[$params['option_weight'][$index]]) ? $defaultArray[$params['option_weight'][$index]] : 0,
'membership_num_terms' => NULL,
- 'non_deductible_amount' => CRM_Utils_Array::value('non_deductible_amount', $params),
+ 'non_deductible_amount' => $params['non_deductible_amount'] ?? NULL,
'visibility_id' => CRM_Utils_Array::value($index, CRM_Utils_Array::value('option_visibility_id', $params), self::getVisibilityOptionID('public')),
];
}
if ($value && empty($field['no_display'])) {
$statistics['filters'][] = [
- 'title' => CRM_Utils_Array::value('title', $field),
+ 'title' => $field['title'] ?? NULL,
'value' => CRM_Utils_String::htmlToText($value),
];
}
$this->_columnHeaders['case_activity_all_dates'] = [
'title' => $this->_caseDetailExtra['case_activity_all_dates']['title'] . ": {$this->caseActivityTypes[$activityType]}",
- 'type' => CRM_Utils_Array::value('type', $this->_caseDetailExtra['case_activity_all_dates']),
+ 'type' => $this->_caseDetailExtra['case_activity_all_dates']['type'] ?? NULL,
];
}
if (!$microformat) {
// replacements in case of Individual Name Format
$replacements = [
- 'contact.display_name' => CRM_Utils_Array::value('display_name', $fields),
- 'contact.individual_prefix' => CRM_Utils_Array::value('individual_prefix', $fields),
- 'contact.formal_title' => CRM_Utils_Array::value('formal_title', $fields),
- 'contact.first_name' => CRM_Utils_Array::value('first_name', $fields),
- 'contact.middle_name' => CRM_Utils_Array::value('middle_name', $fields),
- 'contact.last_name' => CRM_Utils_Array::value('last_name', $fields),
- 'contact.individual_suffix' => CRM_Utils_Array::value('individual_suffix', $fields),
- 'contact.address_name' => CRM_Utils_Array::value('address_name', $fields),
- 'contact.street_address' => CRM_Utils_Array::value('street_address', $fields),
- 'contact.supplemental_address_1' => CRM_Utils_Array::value('supplemental_address_1', $fields),
- 'contact.supplemental_address_2' => CRM_Utils_Array::value('supplemental_address_2', $fields),
- 'contact.supplemental_address_3' => CRM_Utils_Array::value('supplemental_address_3', $fields),
- 'contact.city' => CRM_Utils_Array::value('city', $fields),
- 'contact.state_province_name' => CRM_Utils_Array::value('state_province_name', $fields),
- 'contact.county' => CRM_Utils_Array::value('county', $fields),
- 'contact.state_province' => CRM_Utils_Array::value('state_province', $fields),
+ 'contact.display_name' => $fields['display_name'] ?? NULL,
+ 'contact.individual_prefix' => $fields['individual_prefix'] ?? NULL,
+ 'contact.formal_title' => $fields['formal_title'] ?? NULL,
+ 'contact.first_name' => $fields['first_name'] ?? NULL,
+ 'contact.middle_name' => $fields['middle_name'] ?? NULL,
+ 'contact.last_name' => $fields['last_name'] ?? NULL,
+ 'contact.individual_suffix' => $fields['individual_suffix'] ?? NULL,
+ 'contact.address_name' => $fields['address_name'] ?? NULL,
+ 'contact.street_address' => $fields['street_address'] ?? NULL,
+ 'contact.supplemental_address_1' => $fields['supplemental_address_1'] ?? NULL,
+ 'contact.supplemental_address_2' => $fields['supplemental_address_2'] ?? NULL,
+ 'contact.supplemental_address_3' => $fields['supplemental_address_3'] ?? NULL,
+ 'contact.city' => $fields['city'] ?? NULL,
+ 'contact.state_province_name' => $fields['state_province_name'] ?? NULL,
+ 'contact.county' => $fields['county'] ?? NULL,
+ 'contact.state_province' => $fields['state_province'] ?? NULL,
'contact.postal_code' => $fullPostalCode,
- 'contact.country' => CRM_Utils_Array::value('country', $fields),
- 'contact.world_region' => CRM_Utils_Array::value('world_region', $fields),
- 'contact.geo_code_1' => CRM_Utils_Array::value('geo_code_1', $fields),
- 'contact.geo_code_2' => CRM_Utils_Array::value('geo_code_2', $fields),
- 'contact.current_employer' => CRM_Utils_Array::value('current_employer', $fields),
- 'contact.nick_name' => CRM_Utils_Array::value('nick_name', $fields),
- 'contact.email' => CRM_Utils_Array::value('email', $fields),
- 'contact.im' => CRM_Utils_Array::value('im', $fields),
- 'contact.do_not_email' => CRM_Utils_Array::value('do_not_email', $fields),
- 'contact.do_not_phone' => CRM_Utils_Array::value('do_not_phone', $fields),
- 'contact.do_not_mail' => CRM_Utils_Array::value('do_not_mail', $fields),
- 'contact.do_not_sms' => CRM_Utils_Array::value('do_not_sms', $fields),
- 'contact.do_not_trade' => CRM_Utils_Array::value('do_not_trade', $fields),
- 'contact.job_title' => CRM_Utils_Array::value('job_title', $fields),
- 'contact.birth_date' => CRM_Utils_Array::value('birth_date', $fields),
- 'contact.gender' => CRM_Utils_Array::value('gender', $fields),
- 'contact.is_opt_out' => CRM_Utils_Array::value('is_opt_out', $fields),
- 'contact.preferred_mail_format' => CRM_Utils_Array::value('preferred_mail_format', $fields),
- 'contact.phone' => CRM_Utils_Array::value('phone', $fields),
- 'contact.home_URL' => CRM_Utils_Array::value('home_URL', $fields),
- 'contact.contact_source' => CRM_Utils_Array::value('contact_source', $fields),
- 'contact.external_identifier' => CRM_Utils_Array::value('external_identifier', $fields),
- 'contact.contact_id' => CRM_Utils_Array::value('id', $fields),
- 'contact.household_name' => CRM_Utils_Array::value('display_name', $fields),
- 'contact.organization_name' => CRM_Utils_Array::value('display_name', $fields),
- 'contact.legal_name' => CRM_Utils_Array::value('legal_name', $fields),
- 'contact.preferred_communication_method' => CRM_Utils_Array::value('preferred_communication_method', $fields),
- 'contact.communication_style' => CRM_Utils_Array::value('communication_style', $fields),
- 'contact.addressee' => CRM_Utils_Array::value('addressee_display', $fields),
- 'contact.email_greeting' => CRM_Utils_Array::value('email_greeting_display', $fields),
- 'contact.postal_greeting' => CRM_Utils_Array::value('postal_greeting_display', $fields),
+ 'contact.country' => $fields['country'] ?? NULL,
+ 'contact.world_region' => $fields['world_region'] ?? NULL,
+ 'contact.geo_code_1' => $fields['geo_code_1'] ?? NULL,
+ 'contact.geo_code_2' => $fields['geo_code_2'] ?? NULL,
+ 'contact.current_employer' => $fields['current_employer'] ?? NULL,
+ 'contact.nick_name' => $fields['nick_name'] ?? NULL,
+ 'contact.email' => $fields['email'] ?? NULL,
+ 'contact.im' => $fields['im'] ?? NULL,
+ 'contact.do_not_email' => $fields['do_not_email'] ?? NULL,
+ 'contact.do_not_phone' => $fields['do_not_phone'] ?? NULL,
+ 'contact.do_not_mail' => $fields['do_not_mail'] ?? NULL,
+ 'contact.do_not_sms' => $fields['do_not_sms'] ?? NULL,
+ 'contact.do_not_trade' => $fields['do_not_trade'] ?? NULL,
+ 'contact.job_title' => $fields['job_title'] ?? NULL,
+ 'contact.birth_date' => $fields['birth_date'] ?? NULL,
+ 'contact.gender' => $fields['gender'] ?? NULL,
+ 'contact.is_opt_out' => $fields['is_opt_out'] ?? NULL,
+ 'contact.preferred_mail_format' => $fields['preferred_mail_format'] ?? NULL,
+ 'contact.phone' => $fields['phone'] ?? NULL,
+ 'contact.home_URL' => $fields['home_URL'] ?? NULL,
+ 'contact.contact_source' => $fields['contact_source'] ?? NULL,
+ 'contact.external_identifier' => $fields['external_identifier'] ?? NULL,
+ 'contact.contact_id' => $fields['id'] ?? NULL,
+ 'contact.household_name' => $fields['display_name'] ?? NULL,
+ 'contact.organization_name' => $fields['display_name'] ?? NULL,
+ 'contact.legal_name' => $fields['legal_name'] ?? NULL,
+ 'contact.preferred_communication_method' => $fields['preferred_communication_method'] ?? NULL,
+ 'contact.communication_style' => $fields['communication_style'] ?? NULL,
+ 'contact.addressee' => $fields['addressee_display'] ?? NULL,
+ 'contact.email_greeting' => $fields['email_greeting_display'] ?? NULL,
+ 'contact.postal_greeting' => $fields['postal_greeting_display'] ?? NULL,
];
}
else {
$row = CRM_Admin_Page_Extensions::createExtendedInfo($obj);
switch ($row['status']) {
case CRM_Extension_Manager::STATUS_INSTALLED_MISSING:
- $errors[] = ts('%1 extension (%2) is installed but missing files.', [1 => CRM_Utils_Array::value('label', $row), 2 => $key]);
+ $errors[] = ts('%1 extension (%2) is installed but missing files.', [1 => $row['label'] ?? NULL, 2 => $key]);
break;
case CRM_Extension_Manager::STATUS_INSTALLED:
if (!empty($remotes[$key]) && version_compare($row['version'], $remotes[$key]->version, '<')) {
$updates[] = ts('%1 (%2) version %3 is installed. <a %4>Upgrade to version %5</a>.', [
- 1 => CRM_Utils_Array::value('label', $row),
+ 1 => $row['label'] ?? NULL,
2 => $key,
3 => $row['version'],
4 => 'href="' . CRM_Utils_System::url('civicrm/admin/extensions', "action=update&id=$key&key=$key") . '"',
}
$date = [
- '%b' => CRM_Utils_Array::value($month, $abbrMonths),
- '%B' => CRM_Utils_Array::value($month, $fullMonths),
+ '%b' => $abbrMonths[$month] ?? NULL,
+ '%B' => $fullMonths[$month] ?? NULL,
'%d' => $day > 9 ? $day : '0' . $day,
'%e' => $day > 9 ? $day : ' ' . $day,
'%E' => $day,
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);
'last' => $this->getLastPageLink(),
'currentPage' => $this->getCurrentPageID(),
'numPages' => $this->numPages(),
- 'csvString' => CRM_Utils_Array::value('csvString', $params),
- 'status' => CRM_Utils_Array::value('status', $params),
- 'buttonTop' => CRM_Utils_Array::value('buttonTop', $params),
- 'buttonBottom' => CRM_Utils_Array::value('buttonBottom', $params),
+ 'csvString' => $params['csvString'] ?? NULL,
+ 'status' => $params['status'] ?? NULL,
+ 'buttonTop' => $params['buttonTop'] ?? NULL,
+ 'buttonBottom' => $params['buttonBottom'] ?? NULL,
'currentLocation' => $this->getCurrentLocation(),
];
'type' => $type,
'contact_id' => $contactId,
'contactName' => $contactName,
- 'subtype' => CRM_Utils_Array::value('subtype', $others),
+ 'subtype' => $others['subtype'] ?? NULL,
'isDeleted' => CRM_Utils_Array::value('isDeleted', $others, FALSE),
- 'image_url' => CRM_Utils_Array::value('imageUrl', $others),
- 'edit_url' => CRM_Utils_Array::value('editUrl', $others),
- 'delete_url' => CRM_Utils_Array::value('deleteUrl', $others),
+ 'image_url' => $others['imageUrl'] ?? NULL,
+ 'edit_url' => $others['editUrl'] ?? NULL,
+ 'delete_url' => $others['deleteUrl'] ?? NULL,
]
);
foreach ($vars as $weight => $value) {
$this->_vars[$weight] = [
'name' => CRM_Utils_Type::validate($value['sort'], 'MysqlColumnNameOrAlias'),
- 'direction' => CRM_Utils_Array::value('direction', $value),
+ 'direction' => $value['direction'] ?? NULL,
'title' => $value['name'],
];
}
*/
function _civicrm_api3_activity_check_params(&$params) {
$activityIds = [
- 'activity' => CRM_Utils_Array::value('id', $params),
- 'parent' => CRM_Utils_Array::value('parent_id', $params),
- 'original' => CRM_Utils_Array::value('original_id', $params),
+ 'activity' => $params['id'] ?? NULL,
+ 'parent' => $params['parent_id'] ?? NULL,
+ 'original' => $params['original_id'] ?? NULL,
];
foreach ($activityIds as $id => $value) {
// Initialize XML processor with $params
$xmlProcessor = new CRM_Case_XMLProcessor_Process();
$xmlProcessorParams = [
- 'clientID' => CRM_Utils_Array::value('contact_id', $params),
- 'creatorID' => CRM_Utils_Array::value('creator_id', $params),
+ 'clientID' => $params['contact_id'] ?? NULL,
+ 'creatorID' => $params['creator_id'] ?? NULL,
'standardTimeline' => 1,
'activityTypeName' => 'Open Case',
- 'caseID' => CRM_Utils_Array::value('id', $params),
- 'subject' => CRM_Utils_Array::value('subject', $params),
- 'location' => CRM_Utils_Array::value('location', $params),
- 'activity_date_time' => CRM_Utils_Array::value('start_date', $params),
- 'duration' => CRM_Utils_Array::value('duration', $params),
- 'medium_id' => CRM_Utils_Array::value('medium_id', $params),
- 'details' => CRM_Utils_Array::value('details', $params),
+ 'caseID' => $params['id'] ?? NULL,
+ 'subject' => $params['subject'] ?? NULL,
+ 'location' => $params['location'] ?? NULL,
+ 'activity_date_time' => $params['start_date'] ?? NULL,
+ 'duration' => $params['duration'] ?? NULL,
+ 'medium_id' => $params['medium_id'] ?? NULL,
+ 'details' => $params['details'] ?? NULL,
'custom' => [],
- 'relationship_end_date' => CRM_Utils_Array::value('end_date', $params),
+ 'relationship_end_date' => $params['end_date'] ?? NULL,
];
// Do it! :-D
return civicrm_api3('Contact', 'get', [
'return' => $params['return'],
'id' => ['IN' => $dupes],
- 'options' => CRM_Utils_Array::value('options', $params),
- 'sequential' => CRM_Utils_Array::value('sequential', $params),
- 'check_permissions' => CRM_Utils_Array::value('check_permissions', $params),
+ 'options' => $params['options'] ?? NULL,
+ 'sequential' => $params['sequential'] ?? NULL,
+ 'check_permissions' => $params['check_permissions'] ?? NULL,
]);
}
foreach ($dupes as $dupe) {
$domain['domain_phone'] = [
'phone_type' => CRM_Core_PseudoConstant::getLabel('CRM_Core_BAO_Phone', 'phone_type_id',
CRM_Utils_Array::value('phone_type_id', $values['location']['phone'][1])),
- 'phone' => CRM_Utils_Array::value('phone', $values['location']['phone'][1]),
+ 'phone' => $values['location']['phone'][1]['phone'] ?? NULL,
];
}
$profileFields[$profileID][$fieldName] = array_merge([
'api.required' => $field['is_required'],
'title' => $field['label'],
- 'help_pre' => CRM_Utils_Array::value('help_pre', $field),
- 'help_post' => CRM_Utils_Array::value('help_post', $field),
+ 'help_pre' => $field['help_pre'] ?? NULL,
+ 'help_post' => $field['help_post'] ?? NULL,
'entity' => $entity,
- 'weight' => CRM_Utils_Array::value('weight', $field),
+ 'weight' => $field['weight'] ?? NULL,
], $aliasArray);
$ufFieldTaleFieldName = $field['field_name'];
'exampleUrl' => CRM_Utils_System::url('civicrm/example', NULL, TRUE, NULL, FALSE),
],
'http' => [
- 'software' => CRM_Utils_Array::value('SERVER_SOFTWARE', $_SERVER),
+ 'software' => $_SERVER['SERVER_SOFTWARE'] ?? NULL,
'forwarded' => !empty($_SERVER['HTTP_X_FORWARDED_FOR']) || !empty($_SERVER['X_FORWARDED_PROTO']),
'port' => (empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == 80 || $_SERVER['SERVER_PORT'] == 443) ? 'Standard' : 'Nonstandard',
],
if (empty($path)) {
$menu[] = [
'attributes' => array_merge([
- 'label' => CRM_Utils_Array::value('name', $item),
+ 'label' => $item['name'] ?? NULL,
'active' => 1,
], $item),
];
'is_primary' => 1,
];
$compareParams = [
- 'street_address' => CRM_Utils_Array::value('street_address', $params['address'][1]),
+ 'street_address' => $params['address'][1]['street_address'] ?? NULL,
'supplemental_address_1' => CRM_Utils_Array::value('supplemental_address_1',
$params['address'][1]
),
'supplemental_address_3' => CRM_Utils_Array::value('supplemental_address_3',
$params['address'][1]
),
- 'city' => CRM_Utils_Array::value('city', $params['address'][1]),
- 'postal_code' => CRM_Utils_Array::value('postal_code', $params['address'][1]),
- 'country_id' => CRM_Utils_Array::value('country_id', $params['address'][1]),
+ 'city' => $params['address'][1]['city'] ?? NULL,
+ 'postal_code' => $params['address'][1]['postal_code'] ?? NULL,
+ 'country_id' => $params['address'][1]['country_id'] ?? NULL,
'state_province_id' => CRM_Utils_Array::value('state_province_id',
$params['address'][1]
),
- 'geo_code_1' => CRM_Utils_Array::value('geo_code_1', $params['address'][1]),
- 'geo_code_2' => CRM_Utils_Array::value('geo_code_2', $params['address'][1]),
+ 'geo_code_1' => $params['address'][1]['geo_code_1'] ?? NULL,
+ 'geo_code_2' => $params['address'][1]['geo_code_2'] ?? NULL,
];
$this->assertDBCompareValues('CRM_Core_DAO_Address', $searchParams, $compareParams);
//Now check DB for IM
$compareParams = [
- 'name' => CRM_Utils_Array::value('name', $params['im'][1]),
- 'provider_id' => CRM_Utils_Array::value('provider_id', $params['im'][1]),
+ 'name' => $params['im'][1]['name'] ?? NULL,
+ 'provider_id' => $params['im'][1]['provider_id'] ?? NULL,
];
$this->assertDBCompareValues('CRM_Core_DAO_IM', $searchParams, $compareParams);
'contact_id' => $contactId,
'location_type_id' => 1,
'is_primary' => 1,
- 'phone_type_id' => CRM_Utils_Array::value('phone_type_id', $params['phone'][1]),
+ 'phone_type_id' => $params['phone'][1]['phone_type_id'] ?? NULL,
];
$compareParams = ['phone' => CRM_Utils_Array::value('phone', $params['phone'][1])];
$this->assertDBCompareValues('CRM_Core_DAO_Phone', $searchParams, $compareParams);
$searchParams = [
'contact_id' => $contactId,
'location_type_id' => 1,
- 'phone_type_id' => CRM_Utils_Array::value('phone_type_id', $params['phone'][2]),
+ 'phone_type_id' => $params['phone'][2]['phone_type_id'] ?? NULL,
];
$compareParams = ['phone' => CRM_Utils_Array::value('phone', $params['phone'][2])];
$this->assertDBCompareValues('CRM_Core_DAO_Phone', $searchParams, $compareParams);
'is_primary' => 1,
];
$compareParams = [
- 'street_address' => CRM_Utils_Array::value('street_address-Primary', $profileParams),
- 'supplemental_address_1' => CRM_Utils_Array::value('supplemental_address_1-Primary', $profileParams),
- 'supplemental_address_2' => CRM_Utils_Array::value('supplemental_address_2-Primary', $profileParams),
- 'supplemental_address_3' => CRM_Utils_Array::value('supplemental_address_3-Primary', $profileParams),
- 'city' => CRM_Utils_Array::value('city-Primary', $profileParams),
- 'postal_code' => CRM_Utils_Array::value('postal_code-Primary', $profileParams),
- 'country_id' => CRM_Utils_Array::value('country-Primary', $profileParams),
- 'state_province_id' => CRM_Utils_Array::value('state_province-Primary', $profileParams),
- 'geo_code_1' => CRM_Utils_Array::value('geo_code_1-Primary', $profileParams),
- 'geo_code_2' => CRM_Utils_Array::value('geo_code_2-Primary', $profileParams),
+ 'street_address' => $profileParams['street_address-Primary'] ?? NULL,
+ 'supplemental_address_1' => $profileParams['supplemental_address_1-Primary'] ?? NULL,
+ 'supplemental_address_2' => $profileParams['supplemental_address_2-Primary'] ?? NULL,
+ 'supplemental_address_3' => $profileParams['supplemental_address_3-Primary'] ?? NULL,
+ 'city' => $profileParams['city-Primary'] ?? NULL,
+ 'postal_code' => $profileParams['postal_code-Primary'] ?? NULL,
+ 'country_id' => $profileParams['country-Primary'] ?? NULL,
+ 'state_province_id' => $profileParams['state_province-Primary'] ?? NULL,
+ 'geo_code_1' => $profileParams['geo_code_1-Primary'] ?? NULL,
+ 'geo_code_2' => $profileParams['geo_code_2-Primary'] ?? NULL,
];
$this->assertDBCompareValues('CRM_Core_DAO_Address', $searchParams, $compareParams);
//Now check DB for IM
$compareParams = [
- 'name' => CRM_Utils_Array::value('im-Primary', $profileParams),
- 'provider_id' => CRM_Utils_Array::value('im-Primary-provider_id', $profileParams),
+ 'name' => $profileParams['im-Primary'] ?? NULL,
+ 'provider_id' => $profileParams['im-Primary-provider_id'] ?? NULL,
];
$this->assertDBCompareValues('CRM_Core_DAO_IM', $searchParams, $compareParams);
$searchParams = [
'contact_id' => $contactId,
'location_type_id' => 1,
- 'phone_type_id' => CRM_Utils_Array::value('phone_type_id', $params['phone'][2]),
+ 'phone_type_id' => $params['phone'][2]['phone_type_id'] ?? NULL,
];
$compareParams = ['phone' => CRM_Utils_Array::value('phone-Primary-2', $profileParams)];
'is_primary' => 1,
];
$compareParams = [
- 'street_address' => CRM_Utils_Array::value('street_address-Primary', $updatePfParams),
- 'supplemental_address_1' => CRM_Utils_Array::value('supplemental_address_1-Primary', $updatePfParams),
- 'supplemental_address_2' => CRM_Utils_Array::value('supplemental_address_2-Primary', $updatePfParams),
- 'supplemental_address_3' => CRM_Utils_Array::value('supplemental_address_3-Primary', $updatePfParams),
- 'city' => CRM_Utils_Array::value('city-Primary', $updatePfParams),
- 'postal_code' => CRM_Utils_Array::value('postal_code-Primary', $updatePfParams),
- 'country_id' => CRM_Utils_Array::value('country-Primary', $updatePfParams),
- 'state_province_id' => CRM_Utils_Array::value('state_province-Primary', $updatePfParams),
- 'geo_code_1' => CRM_Utils_Array::value('geo_code_1-Primary', $updatePfParams),
- 'geo_code_2' => CRM_Utils_Array::value('geo_code_2-Primary', $updatePfParams),
+ 'street_address' => $updatePfParams['street_address-Primary'] ?? NULL,
+ 'supplemental_address_1' => $updatePfParams['supplemental_address_1-Primary'] ?? NULL,
+ 'supplemental_address_2' => $updatePfParams['supplemental_address_2-Primary'] ?? NULL,
+ 'supplemental_address_3' => $updatePfParams['supplemental_address_3-Primary'] ?? NULL,
+ 'city' => $updatePfParams['city-Primary'] ?? NULL,
+ 'postal_code' => $updatePfParams['postal_code-Primary'] ?? NULL,
+ 'country_id' => $updatePfParams['country-Primary'] ?? NULL,
+ 'state_province_id' => $updatePfParams['state_province-Primary'] ?? NULL,
+ 'geo_code_1' => $updatePfParams['geo_code_1-Primary'] ?? NULL,
+ 'geo_code_2' => $updatePfParams['geo_code_2-Primary'] ?? NULL,
];
$this->assertDBCompareValues('CRM_Core_DAO_Address', $searchParams, $compareParams);
//Now check DB for IM
$compareParams = [
- 'name' => CRM_Utils_Array::value('im-Primary', $updatePfParams),
- 'provider_id' => CRM_Utils_Array::value('im-Primary-provider_id', $updatePfParams),
+ 'name' => $updatePfParams['im-Primary'] ?? NULL,
+ 'provider_id' => $updatePfParams['im-Primary-provider_id'] ?? NULL,
];
$this->assertDBCompareValues('CRM_Core_DAO_IM', $searchParams, $compareParams);
$searchParams = [
'contact_id' => $contactId,
'location_type_id' => 1,
- 'phone_type_id' => CRM_Utils_Array::value('phone_type_id', $params['phone'][2]),
+ 'phone_type_id' => $params['phone'][2]['phone_type_id'] ?? NULL,
];
$compareParams = ['phone' => CRM_Utils_Array::value('phone-Primary-2', $updatePfParams)];
$this->assertDBCompareValues('CRM_Core_DAO_Phone', $searchParams, $compareParams);
'is_primary' => 1,
];
$compareParams = [
- 'street_address' => CRM_Utils_Array::value('street_address-Primary', $updatePfParams),
+ 'street_address' => $updatePfParams['street_address-Primary'] ?? NULL,
];
$this->assertDBCompareValues('CRM_Core_DAO_Address', $searchParams, $compareParams);
//Now check DB for location elements.
$searchParams = [
- 'id' => CRM_Utils_Array::value('address_id', $locElementIds),
+ 'id' => $locElementIds['address_id'] ?? NULL,
'location_type_id' => 1,
'is_primary' => 1,
];
$this->assertDBCompareValues('CRM_Core_DAO_Address', $searchParams, $compareParams);
$searchParams = [
- 'id' => CRM_Utils_Array::value('email_id', $locElementIds),
+ 'id' => $locElementIds['email_id'] ?? NULL,
'location_type_id' => 1,
'is_primary' => 1,
];
$this->assertDBCompareValues('CRM_Core_DAO_Email', $searchParams, $compareParams);
$searchParams = [
- 'id' => CRM_Utils_Array::value('phone_id', $locElementIds),
+ 'id' => $locElementIds['phone_id'] ?? NULL,
'location_type_id' => 1,
'is_primary' => 1,
'phone_type_id' => 1,
$this->assertDBCompareValues('CRM_Core_DAO_Phone', $searchParams, $compareParams);
$searchParams = [
- 'id' => CRM_Utils_Array::value('phone_2_id', $locElementIds),
+ 'id' => $locElementIds['phone_2_id'] ?? NULL,
'location_type_id' => 1,
'phone_type_id' => 2,
];
$this->assertDBCompareValues('CRM_Core_DAO_Phone', $searchParams, $compareParams);
$searchParams = [
- 'id' => CRM_Utils_Array::value('im_id', $locElementIds),
+ 'id' => $locElementIds['im_id'] ?? NULL,
'location_type_id' => 1,
'is_primary' => 1,
];
$navId++;
$menu[$navId] = [
'attributes' => array_merge($item, [
- 'label' => CRM_Utils_Array::value('name', $item),
+ 'label' => $item['name'] ?? NULL,
'active' => 1,
'parentID' => $parentId,
'navID' => $navId,