Use correct caps for CRM_Core_PseudoConstant everywhere
authorAndrew Hunt <andrew@aghstrategies.com>
Mon, 1 Jul 2019 21:53:29 +0000 (17:53 -0400)
committerAndrew Hunt <andrew@aghstrategies.com>
Mon, 1 Jul 2019 21:56:03 +0000 (17:56 -0400)
12 files changed:
CRM/Batch/Form/Entry.php
CRM/Core/BAO/CustomField.php
CRM/Core/BAO/FinancialTrxn.php
CRM/Core/OptionGroup.php
CRM/Core/Payment/PayPalIPN.php
CRM/Core/Payment/PayPalProIPN.php
CRM/Report/Form/Contact/Relationship.php
api/v3/Activity.php
api/v3/Campaign.php
api/v3/Event.php
tests/phpunit/CRM/Contribute/Form/SearchTest.php
tests/phpunit/CRM/Member/Form/MembershipTest.php

index 4d0671fa8e349200eeca6943dedab5e811adb405..b787b344a5f5307c8f10abbcd64d9e4355b7b712 100644 (file)
@@ -143,7 +143,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
 
     $this->addElement('hidden', 'batch_id', $this->_batchId);
 
-    $batchTypes = CRM_Core_Pseudoconstant::get('CRM_Batch_DAO_Batch', 'type_id', ['flip' => 1], 'validate');
+    $batchTypes = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'type_id', ['flip' => 1], 'validate');
     // get the profile information
     if ($this->_batchInfo['type_id'] == $batchTypes['Contribution']) {
       CRM_Utils_System::setTitle(ts('Batch Data Entry for Contributions'));
@@ -298,7 +298,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
    */
   public static function formRule($params, $files, $self) {
     $errors = [];
-    $batchTypes = CRM_Core_Pseudoconstant::get('CRM_Batch_DAO_Batch', 'type_id', ['flip' => 1], 'validate');
+    $batchTypes = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'type_id', ['flip' => 1], 'validate');
     $fields = [
       'total_amount' => ts('Amount'),
       'financial_type' => ts('Financial Type'),
@@ -564,7 +564,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
         $value['skipCleanMoney'] = TRUE;
         //finally call contribution create for all the magic
         $contribution = CRM_Contribute_BAO_Contribution::create($value);
-        $batchTypes = CRM_Core_Pseudoconstant::get('CRM_Batch_DAO_Batch', 'type_id', ['flip' => 1], 'validate');
+        $batchTypes = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'type_id', ['flip' => 1], 'validate');
         if (!empty($this->_batchInfo['type_id']) && ($this->_batchInfo['type_id'] == $batchTypes['Pledge Payment'])) {
           $adjustTotalAmount = FALSE;
           if (isset($params['option_type'][$key])) {
index 8d22e52f2198620bccf52113d58a0ea84ecdba80..c0fb792829067804c2ddadabe8ba9dd9231d75eb 100644 (file)
@@ -416,10 +416,10 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
       );
     }
     elseif ($this->data_type === 'StateProvince') {
-      $options = CRM_Core_Pseudoconstant::stateProvince();
+      $options = CRM_Core_PseudoConstant::stateProvince();
     }
     elseif ($this->data_type === 'Country') {
-      $options = $context == 'validate' ? CRM_Core_Pseudoconstant::countryIsoCode() : CRM_Core_Pseudoconstant::country();
+      $options = $context == 'validate' ? CRM_Core_PseudoConstant::countryIsoCode() : CRM_Core_PseudoConstant::country();
     }
     elseif ($this->data_type === 'Boolean') {
       $options = $context == 'validate' ? array(0, 1) : CRM_Core_SelectValues::boolean();
index 6b3d4533699282c6d077934652dc70491997ed5a..742ad4aeb256d9ec7c8b7846f6a5f50a8d509f45 100644 (file)
@@ -429,7 +429,7 @@ WHERE ceft.entity_id = %1";
         'transaction_date' => date('YmdHis'),
         'amount' => $amount,
         'description' => 'Fee',
-        'status_id' => CRM_Core_Pseudoconstant::getKey('CRM_Financial_BAO_FinancialItem', 'status_id', 'Paid'),
+        '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'],
index 913f874d50b6c903b3311c3024f2e31d41b6bb38..1bf006722df30446c60697cf145ac7212254387c 100644 (file)
@@ -334,7 +334,7 @@ WHERE  v.option_group_id = g.id
   }
 
   /**
-   * @deprecated - use CRM_Core_Pseudoconstant::getLabel
+   * @deprecated - use CRM_Core_PseudoConstant::getLabel
    *
    * @param string $groupName
    * @param $value
index cb68eff20150595844cdcd91f912d5a8bdced2b3..5e0a1034be1feaba173335be77e25f0e6474da8e 100644 (file)
@@ -290,7 +290,7 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN {
     }
 
     // check if contribution is already completed, if so we ignore this ipn
-    $completedStatusId = CRM_Core_Pseudoconstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed');
+    $completedStatusId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed');
     if ($contribution->contribution_status_id == $completedStatusId) {
       $transaction->commit();
       Civi::log()->debug('PayPalIPN: Returning since contribution has already been handled. (ID: ' . $contribution->id . ').');
@@ -343,7 +343,7 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN {
       if ($ids['contributionRecur']) {
         // check if first contribution is completed, else complete first contribution
         $first = TRUE;
-        $completedStatusId = CRM_Core_Pseudoconstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed');
+        $completedStatusId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed');
         if ($objects['contribution']->contribution_status_id == $completedStatusId) {
           $first = FALSE;
         }
index be4da0c8fc748fd27f111c197d22bd6092e3af1d..0324019d9ff2b0584222bbc2909ec1a4d1b4b488 100644 (file)
@@ -381,7 +381,7 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN {
     }
 
     // check if contribution is already completed, if so we ignore this ipn
-    $completedStatusId = CRM_Core_Pseudoconstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed');
+    $completedStatusId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed');
     if ($contribution->contribution_status_id == $completedStatusId) {
       $transaction->commit();
       Civi::log()->debug('PayPalProIPN: Returning since contribution has already been handled.');
@@ -487,7 +487,7 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr
       if ($ids['contributionRecur']) {
         // check if first contribution is completed, else complete first contribution
         $first = TRUE;
-        $completedStatusId = CRM_Core_Pseudoconstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed');
+        $completedStatusId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed');
         if ($objects['contribution']->contribution_status_id == $completedStatusId) {
           $first = FALSE;
         }
@@ -586,7 +586,7 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr
 
     $ids['contribution'] = $result['id'];
     //@todo hardcoding 'pending' for now
-    $pendingStatusId = CRM_Core_Pseudoconstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Pending');
+    $pendingStatusId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Pending');
     if ($result['contribution_status_id'] == $pendingStatusId) {
       $isFirst = TRUE;
     }
index c29ec8e5058c440f10a09eba29c87ce26b681490..bb0816c8db6a92f2eae44551108805f38b1fb044 100644 (file)
@@ -696,7 +696,7 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form {
           $rowLabels = [];
           foreach ($rowValues as $rowValue) {
             if ($rowValue) {
-              $rowLabels[] = CRM_Core_Pseudoconstant::getLabel('CRM_Contact_BAO_Contact', 'contact_sub_type', $rowValue);
+              $rowLabels[] = CRM_Core_PseudoConstant::getLabel('CRM_Contact_BAO_Contact', 'contact_sub_type', $rowValue);
             }
           }
           $rows[$rowNum]['civicrm_contact_contact_sub_type_a'] = implode(', ', $rowLabels);
@@ -712,7 +712,7 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form {
           $rowLabels = [];
           foreach ($rowValues as $rowValue) {
             if ($rowValue) {
-              $rowLabels[] = CRM_Core_Pseudoconstant::getLabel('CRM_Contact_BAO_Contact', 'contact_sub_type', $rowValue);
+              $rowLabels[] = CRM_Core_PseudoConstant::getLabel('CRM_Contact_BAO_Contact', 'contact_sub_type', $rowValue);
             }
           }
           $rows[$rowNum]['civicrm_contact_b_contact_sub_type_b'] = implode(', ', $rowLabels);
index 4aa31a9da1baaa80b73205193ca0855023052516..784095e0e444c35fa2108d5b4457b440c8a48de6 100644 (file)
@@ -354,10 +354,11 @@ function civicrm_api3_activity_get($params) {
  */
 function _civicrm_activity_get_handleSourceContactNameOrderBy(&$params, &$options, $sql) {
   $sourceContactID = CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_ActivityContact', 'record_type_id', 'Activity Source');
-  if (!empty($options['sort']) && in_array($options['sort'], [
+  if (!empty($options['sort'])
+    && in_array($options['sort'], [
       'source_contact_name',
       'source_contact_name desc',
-      'source_contact_name asc'
+      'source_contact_name asc',
     ])) {
     $order = substr($options['sort'], -4) === 'desc' ? 'desc' : 'asc';
     $sql->join(
@@ -805,7 +806,7 @@ function _civicrm_api3_activity_getlist_output($result, $request) {
         'id' => $row[$request['id_field']],
         'label' => $row[$request['label_field']] ? $row[$request['label_field']] : ts('(no subject)'),
         'description' => [
-          CRM_Core_Pseudoconstant::getLabel('CRM_Activity_BAO_Activity', 'activity_type_id', $row['activity_type_id']),
+          CRM_Core_PseudoConstant::getLabel('CRM_Activity_BAO_Activity', 'activity_type_id', $row['activity_type_id']),
         ],
       ];
       if (!empty($row['activity_date_time'])) {
index 29c6be4720f3bcb954333b627679790363480b2b..383d556f0409fa9c7ce178586d9ea4e048a15c36 100644 (file)
@@ -126,11 +126,11 @@ function _civicrm_api3_campaign_getlist_output($result, $request) {
         'id' => $row[$request['id_field']],
         'label' => $row[$request['label_field']],
         'description' => [
-          CRM_Core_Pseudoconstant::getLabel('CRM_Campaign_BAO_Campaign', 'campaign_type_id', $row['campaign_type_id']),
+          CRM_Core_PseudoConstant::getLabel('CRM_Campaign_BAO_Campaign', 'campaign_type_id', $row['campaign_type_id']),
         ],
       ];
       if (!empty($row['status_id'])) {
-        $data['description'][0] .= ': ' . CRM_Core_Pseudoconstant::getLabel('CRM_Campaign_BAO_Campaign', 'status_id', $row['status_id']);
+        $data['description'][0] .= ': ' . CRM_Core_PseudoConstant::getLabel('CRM_Campaign_BAO_Campaign', 'status_id', $row['status_id']);
       }
       $dateString = CRM_Utils_Date::customFormat($row['start_date'], $config->dateformatFull) . ' -';
       if (!empty($row['end_date'])) {
index 5f58ebc6755a8ad7b7e4352172dadd8bddf0b8e1..b3dbd7adcddc5658a359fdf6978eb76d6c5aff23 100644 (file)
@@ -254,7 +254,7 @@ function _civicrm_api3_event_getlist_output($result, $request) {
         'id' => $row[$request['id_field']],
         'label' => $row[$request['label_field']],
         'description' => [
-          CRM_Core_Pseudoconstant::getLabel('CRM_Event_BAO_Event', 'event_type_id', $row['event_type_id']),
+          CRM_Core_PseudoConstant::getLabel('CRM_Event_BAO_Event', 'event_type_id', $row['event_type_id']),
         ],
       ];
       if (!empty($row['start_date'])) {
index f773d1dd5ba16c73779a8ee7e18aab0c4c599ef5..fab3b2d36a81c944b6e0d2c92d4ef8ba7e5de4f4 100644 (file)
@@ -64,7 +64,7 @@ class CRM_Contribute_Form_SearchTest extends CiviUnitTestCase {
     $batch = $this->callAPISuccess('Batch', 'create', [
       'created_id' => $this->_individual,
       'created_date' => CRM_Utils_Date::processDate(date("Y-m-d"), date("H:i:s")),
-      'status_id' => CRM_Core_Pseudoconstant::getKey('CRM_Batch_BAO_Batch', 'status_id', 'Data Entry'),
+      'status_id' => CRM_Core_PseudoConstant::getKey('CRM_Batch_BAO_Batch', 'status_id', 'Data Entry'),
       'title' => $batchTitle,
       'item_count' => 2,
       'total' => 100,
index d9db47e38c7fc667ecacc60a140a9e6dfc6c0592..f00b4fa1be7e610335bd71f82bf218191b3d155a 100644 (file)
@@ -1339,7 +1339,7 @@ Expires: ',
       'contact_id' => $this->_individualId,
       'id' => $lineItem['contribution_id'],
       'financial_type_id' => 2,
-      'contribution_status_id' => CRM_Core_Pseudoconstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed'),
+      'contribution_status_id' => CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed'),
     ),
     CRM_Core_Action::UPDATE);