$sid
);
- if (CRM_Utils_Array::value('activity_type', $surveysData[$sid]) != 'Petition') {
+ if (($surveysData[$sid]['activity_type'] ?? NULL) != 'Petition') {
$surveysData[$sid]['voterLinks'] = CRM_Campaign_BAO_Survey::buildPermissionLinks($sid,
TRUE,
ts('more')
$optionValues = CRM_Core_OptionValue::getRows($groupParams, $this->links(), 'component_id,weight');
foreach ($optionValues as $key => $optionValue) {
- if (CRM_Utils_Array::value('component_id', $optionValue) != $campaingCompId) {
+ if (($optionValue['component_id'] ?? NULL) != $campaingCompId) {
unset($optionValues[$key]);
}
}
$displayName = $info['display_name'] ?? NULL;
- [$result[CRM_Utils_Array::value('contact_id', $info)], $subject, $message, $html] = CRM_Core_BAO_MessageTemplate::sendTemplate(
+ [$result[$info['contact_id'] ?? NULL], $subject, $message, $html] = CRM_Core_BAO_MessageTemplate::sendTemplate(
[
'groupName' => 'msg_tpl_workflow_case',
'workflow' => 'case_activity',
$recordedActivityParams['target_contact_id'][] = $info['contact_id'];
}
else {
- unset($result[CRM_Utils_Array::value('contact_id', $info)]);
+ unset($result[$info['contact_id'] ?? NULL]);
}
}
);
}
if (!array_key_exists(CRM_Utils_Array::value('display_name', $client), $report->_redactionStringRules)) {
- $report->_redactionStringRules[CRM_Utils_Array::value('display_name', $client)] = $report->_redactionStringRules[CRM_Utils_Array::value('sort_name', $client)];
+ $report->_redactionStringRules[$client['display_name'] ?? NULL] = $report->_redactionStringRules[$client['sort_name'] ?? NULL];
}
$client['sort_name'] = $report->redact(CRM_Utils_Array::value('sort_name', $client), TRUE, $report->_redactionStringRules);
if (!empty($client['email']) &&
}
$pseudoConstant = $realField['pseudoconstant'];
if (empty($pseudoConstant['optionGroupName']) &&
- CRM_Utils_Array::value('labelColumn', $pseudoConstant) !== 'name') {
+ ($pseudoConstant['labelColumn'] ?? NULL) !== 'name') {
// We are increasing our pseudoconstant handling - but still very cautiously,
// hence the check for labelColumn === name
return FALSE;
*/
protected function isPseudoFieldAnFK($fieldSpec) {
if (empty($fieldSpec['FKClassName'])
- || CRM_Utils_Array::value('keyColumn', $fieldSpec['pseudoconstant']) !== 'id'
- || CRM_Utils_Array::value('labelColumn', $fieldSpec['pseudoconstant']) !== 'name') {
+ || ($fieldSpec['pseudoconstant']['keyColumn'] ?? NULL) !== 'id'
+ || ($fieldSpec['pseudoconstant']['labelColumn'] ?? NULL) !== 'name') {
return FALSE;
}
return TRUE;
unset($form->_contactDetails[$contactId]);
continue;
}
- elseif ($contactDetails['phone_type_id'] != CRM_Utils_Array::value('Mobile', $phoneTypes)) {
+ elseif ($contactDetails['phone_type_id'] != ($phoneTypes['Mobile'] ?? NULL)) {
//if phone is not primary check if non-primary phone is "Mobile"
$filter = ['do_not_sms' => 0];
$contactPhones = CRM_Core_BAO_Phone::allPhones($contactId, FALSE, 'Mobile', $filter);
}
if (!isset($params['id']) ||
- (CRM_Utils_Array::value('parent_id', $params) != CRM_Utils_Array::value('current_parent_id', $params))
+ (($params['parent_id'] ?? NULL) != ($params['current_parent_id'] ?? NULL))
) {
/* re/calculate the weight, if the Parent ID changed OR create new menu */
[, $id] = explode('_', $name);
$label = $props['label'] ?? CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', 'label', $id);
$gid = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', 'option_group_id', $id);
- if (CRM_Utils_Array::value('context', $props) != 'search') {
+ if (($props['context'] ?? NULL) != 'search') {
$props['data-option-edit-path'] = array_key_exists('option_url', $props) ? $props['option_url'] : 'civicrm/admin/options/' . CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $gid);
}
}
}
}
$label = $props['label'] ?? $fieldSpec['html']['label'] ?? $fieldSpec['title'];
- if (CRM_Utils_Array::value('context', $props) != 'search') {
+ if (($props['context'] ?? NULL) != 'search') {
$props['data-option-edit-path'] = array_key_exists('option_url', $props) ? $props['option_url'] : CRM_Core_PseudoConstant::getOptionEditUrl($fieldSpec);
}
}
$updateStatusMsg = NULL;
//send mail when participant status changed, CRM-4326
if ($this->_id && $this->_statusId &&
- $this->_statusId != CRM_Utils_Array::value('status_id', $params) && !empty($params['is_notify'])
+ $this->_statusId != ($params['status_id'] ?? NULL) && !empty($params['is_notify'])
) {
$updateStatusMsg = CRM_Event_BAO_Participant::updateStatusMessage($this->_id,
foreach ($priceSetFields as $fid => $fieldValues) {
if (!is_array($fieldValues['options']) ||
empty($fieldValues['options']) ||
- (CRM_Utils_Array::value('visibility_id', $fieldValues) != array_search('public', $visibility) && $adminFieldVisible == FALSE)
+ (($fieldValues['visibility_id'] ?? NULL) != array_search('public', $visibility) && $adminFieldVisible == FALSE)
) {
continue;
}
}
foreach ($fieldValues['options'] as $optionId => $optionVal) {
- if (CRM_Utils_Array::value('visibility_id', $optionVal) != array_search('public', $visibility) &&
+ if (($optionVal['visibility_id'] ?? NULL) != array_search('public', $visibility) &&
$adminFieldVisible == FALSE
) {
continue;
public static function validateRelationship($financialTypeAccount) {
$financialAccountLinks = CRM_Financial_BAO_FinancialAccount::getfinancialAccountRelations();
$financialAccountType = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialAccount', $financialTypeAccount->financial_account_id, 'financial_account_type_id');
- if (CRM_Utils_Array::value($financialTypeAccount->account_relationship, $financialAccountLinks) != $financialAccountType) {
+ if (($financialAccountLinks[$financialTypeAccount->account_relationship] ?? NULL) != $financialAccountType) {
$accountRelationships = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_EntityFinancialAccount', 'account_relationship');
throw new CRM_Core_Exception(ts("This financial account cannot have '%1' relationship.", [1 => $accountRelationships[$financialTypeAccount->account_relationship]]));
}
$errorMsg['tax_rate'] = ts('Please enter value for tax rate');
}
}
- if ((CRM_Utils_Array::value('tax_rate', $values) != NULL)) {
+ if ((($values['tax_rate'] ?? NULL) != NULL)) {
if ($values['tax_rate'] < 0 || $values['tax_rate'] >= 100) {
$errorMsg['tax_rate'] = ts('Tax Rate Should be between 0 - 100');
}
$errorFlag = FALSE;
if ($self->_action == CRM_Core_Action::DELETE) {
$relationValues = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_EntityFinancialAccount', 'account_relationship');
- if (CRM_Utils_Array::value('financial_account_id', $values) != 'select') {
+ if (($values['financial_account_id'] ?? NULL) != 'select') {
if ($relationValues[$values['account_relationship']] == 'Premiums Inventory Account is' || $relationValues[$values['account_relationship']] == 'Cost of Sales Account is') {
$premiumsProduct = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_PremiumsProduct', $values['financial_type_id'], 'product_id', 'financial_type_id');
$product = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Product', $values['financial_type_id'], 'name', 'financial_type_id');
if (!empty($specDiff) && $col !== 'id' && !in_array($col, $diff['ADD'])) {
if (empty($colSpecs['EXTRA']) || (!empty($colSpecs['EXTRA']) && $colSpecs['EXTRA'] !== 'auto_increment')) {
// ignore 'id' column for any spec changes, to avoid any auto-increment mysql errors
- if ($civiTableSpecs[$col]['DATA_TYPE'] != CRM_Utils_Array::value('DATA_TYPE', $logTableSpecs[$col])
+ if ($civiTableSpecs[$col]['DATA_TYPE'] != ($logTableSpecs[$col]['DATA_TYPE'] ?? NULL)
// We won't alter the log if the length is decreased in case some of the existing data won't fit.
|| CRM_Utils_Array::value('LENGTH', $civiTableSpecs[$col]) > CRM_Utils_Array::value('LENGTH', $logTableSpecs[$col])
) {
$diff['MODIFY'][] = $col;
}
elseif ($civiTableSpecs[$col]['DATA_TYPE'] === 'enum' &&
- CRM_Utils_Array::value('ENUM_VALUES', $civiTableSpecs[$col]) != CRM_Utils_Array::value('ENUM_VALUES', $logTableSpecs[$col])
+ ($civiTableSpecs[$col]['ENUM_VALUES'] ?? NULL) != ($logTableSpecs[$col]['ENUM_VALUES'] ?? NULL)
) {
// column is enum and the permitted values have changed
$diff['MODIFY'][] = $col;
}
- elseif ($civiTableSpecs[$col]['IS_NULLABLE'] != CRM_Utils_Array::value('IS_NULLABLE', $logTableSpecs[$col]) &&
+ elseif ($civiTableSpecs[$col]['IS_NULLABLE'] != ($logTableSpecs[$col]['IS_NULLABLE'] ?? NULL) &&
$logTableSpecs[$col]['IS_NULLABLE'] === 'NO'
) {
// if is-null property is different, and log table's column is NOT-NULL, surely consider the column
'pageComponent' => $this->_component,
];
- if (!$pcpBlock->is_tellfriend_enabled || CRM_Utils_Array::value('status_id', $pcpInfo) != $approvedId) {
+ if (!$pcpBlock->is_tellfriend_enabled || ($pcpInfo['status_id'] ?? NULL) != $approvedId) {
unset($link['all'][CRM_Core_Action::DETACH]);
}
$this->assign('eachPaymentAmount', $eachPaymentAmount);
}
- if (CRM_Utils_Array::value('status_id', $this->_values) !=
+ if (($this->_values['status_id'] ?? NULL) !=
CRM_Core_PseudoConstant::getKey('CRM_Pledge_BAO_Pledge', 'status_id', 'Cancelled')
) {
if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($name)) {
$htmlType = $field['html_type'];
if ((!isset($this->_defaults[$name]) || $htmlType == 'File') &&
- (CRM_Utils_Array::value('field_type', $field) != 'Activity')
+ (($field['field_type'] ?? NULL) != 'Activity')
) {
CRM_Core_BAO_CustomField::setProfileDefaults($customFieldID,
$name,
foreach ($table['filters'] as $fieldName => $field) {
if ((CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_DATE ||
CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_TIME) &&
- CRM_Utils_Array::value('operatorType', $field) !=
+ ($field['operatorType'] ?? NULL) !=
CRM_Report_Form::OP_MONTH
) {
$from = $this->_params["{$fieldName}_from"] ?? NULL;
// Stats for soft credits
if ($this->_softFrom &&
- CRM_Utils_Array::value('contribution_or_soft_value', $this->_params) !=
+ ($this->_params['contribution_or_soft_value'] ?? NULL) !=
'contributions_only'
) {
$totalAmount = $average = [];
// CRM-17310 private reports option.
$defaults['add_to_my_reports'] = 0;
- if (CRM_Utils_Array::value('owner_id', $defaults) != NULL) {
+ if (($defaults['owner_id'] ?? NULL) != NULL) {
$defaults['add_to_my_reports'] = 1;
}
$params = ['id' => $customField->custom_group_id];
$customGroup = [];
CRM_Core_BAO_CustomGroup::retrieve($params, $customGroup);
- if (($fieldType != CRM_Utils_Array::value('extends', $customGroup)) || empty($customGroup['extends_entity_column_value'])) {
+ if (($fieldType != ($customGroup['extends'] ?? NULL)) || empty($customGroup['extends_entity_column_value'])) {
return $errors;
}
$date['d'] = sprintf('%02d', $date['d']);
$time = '';
- if (CRM_Utils_Array::value('H', $date) != NULL ||
- CRM_Utils_Array::value('h', $date) != NULL ||
- CRM_Utils_Array::value('i', $date) != NULL ||
- CRM_Utils_Array::value('s', $date) != NULL
+ if (!empty($date['H']) ||
+ !empty($date['h']) ||
+ !empty($date['i']) ||
+ !empty($date['s'])
) {
// we have time too..
if (!empty($date['h'])) {
// else if a value is set that has higher priority and finally the GET var
$currentPage = $defaultPageId;
if (!empty($_POST)) {
- if (isset($_POST[CRM_Utils_Array::value('buttonTop', $params)]) && isset($_POST[self::PAGE_ID])) {
+ if (isset($_POST[$params['buttonTop']]) && isset($_POST[self::PAGE_ID])) {
$currentPage = max((int ) @$_POST[self::PAGE_ID], 1);
}
elseif (isset($_POST[$params['buttonBottom']]) && isset($_POST[self::PAGE_ID_BOTTOM])) {