From a28ce73f4418e6fa203cc172be6968f6edd903ca Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 21 Apr 2017 15:07:47 +1200 Subject: [PATCH] CRM-20459 replace last instances where CRM_Core_OptionGroup::getValue is called --- CRM/Batch/BAO/Batch.php | 2 +- CRM/Contribute/BAO/Contribution.php | 2 +- CRM/Core/BAO/FinancialTrxn.php | 4 ++-- api/v3/Contribution.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CRM/Batch/BAO/Batch.php b/CRM/Batch/BAO/Batch.php index cd9f06f509..541669a584 100644 --- a/CRM/Batch/BAO/Batch.php +++ b/CRM/Batch/BAO/Batch.php @@ -502,7 +502,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { * all batches excluding batches with data entry in progress */ public static function getBatches() { - $dataEntryStatusId = CRM_Core_OptionGroup::getValue('batch_status', 'Data Entry', 'name'); + $dataEntryStatusId = CRM_Core_PseudoConstant::getKey('CRM_Batch_BAO_Batch', 'status_id', 'Data Entry'); $query = "SELECT id, title FROM civicrm_batch WHERE item_count >= 1 diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index a6d6b67f5d..b98a4a05f2 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -3542,7 +3542,7 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac foreach ($params['line_item'] as $fieldId => $fields) { foreach ($fields as $fieldValueId => $fieldValues) { $fparams = array( - 1 => array(CRM_Core_OptionGroup::getValue('financial_item_status', 'Paid', 'name'), 'Integer'), + 1 => array(CRM_Core_PseudoConstant::getKey('CRM_Financial_BAO_FinancialItem', 'status_id', 'Paid'), 'Integer'), 2 => array($fieldValues['id'], 'Integer'), ); CRM_Core_DAO::executeQuery($query, $fparams); diff --git a/CRM/Core/BAO/FinancialTrxn.php b/CRM/Core/BAO/FinancialTrxn.php index f2f448c3dd..4322cc8b96 100644 --- a/CRM/Core/BAO/FinancialTrxn.php +++ b/CRM/Core/BAO/FinancialTrxn.php @@ -436,13 +436,13 @@ WHERE ceft.entity_id = %1"; 'transaction_date' => date('YmdHis'), 'amount' => $amount, 'description' => 'Fee', - 'status_id' => CRM_Core_OptionGroup::getValue('financial_item_status', 'Paid', 'name'), + 'status_id' => CRM_Core_Pseudoconstant::getKey('CRM_Financial_BAO_FinancialItem', 'status_id', 'Paid'), 'entity_table' => 'civicrm_financial_trxn', 'entity_id' => $params['entity_id'], 'currency' => $params['trxnParams']['currency'], ); $trxnIDS['id'] = $trxn->id; - $financialItem = CRM_Financial_BAO_FinancialItem::create($fItemParams, NULL, $trxnIDS); + CRM_Financial_BAO_FinancialItem::create($fItemParams, NULL, $trxnIDS); } /** diff --git a/api/v3/Contribution.php b/api/v3/Contribution.php index 033091ce39..6866d5196d 100644 --- a/api/v3/Contribution.php +++ b/api/v3/Contribution.php @@ -192,7 +192,7 @@ function _civicrm_api3_contribution_create_legacy_support_45(&$params) { $params['soft_credit'][] = array( 'contact_id' => $params['honor_contact_id'], 'amount' => $params['total_amount'], - 'soft_credit_type_id' => CRM_Utils_Array::value('honor_type_id', $params, CRM_Core_OptionGroup::getValue('soft_credit_type', 'in_honor_of', 'name')), + 'soft_credit_type_id' => CRM_Utils_Array::value('honor_type_id', $params, CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_ContributionSoft', 'soft_credit_type_id', 'in_honor_of')), ); } } -- 2.25.1