diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index 778adbaa42a36a943c8caeeeda8c2d87f0b05c03..80a7702f519ed419bed1234a062e290aabec3d26 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -379,5 +379,15 @@ INNER JOIN civicrm_contribution con ON ( con.contribution_recur_id = rec.id ) return $newCredit; } + /* Return a static array of available billing modes, in the format: + * $array[numeric key] = 'descriptive text'. + */ + static function getBillingModes() { + return array( + CRM_Core_Payment::BILLING_MODE_FORM => 'form', + CRM_Core_Payment::BILLING_MODE_BUTTON => 'button', + CRM_Core_Payment::BILLING_MODE_NOTIFY => 'notify', + ); + } } diff --git a/CRM/Core/PseudoConstant.php b/CRM/Core/PseudoConstant.php index bb8e4bf77489ae8156221cc5d7f490ec5668e0ce..82e834fd724075778935b8ccb9b1064352540504 100644 --- a/CRM/Core/PseudoConstant.php +++ b/CRM/Core/PseudoConstant.php @@ -65,13 +65,6 @@ class CRM_Core_PseudoConstant { */ private static $activityType; - /** - * payment processor billing modes - * @var array - * @static - */ - private static $billingMode; - /** * states, provinces * @var array @@ -542,25 +535,6 @@ class CRM_Core_PseudoConstant { } return self::$activityType[$index]; } - - /** - * Get all payment-processor billing modes - * - * @access public - * @static - * - * @return array ($id => $name) - */ - public static function billingMode() { - if (!self::$billingMode) { - self::$billingMode = array( - CRM_Core_Payment::BILLING_MODE_FORM => 'form', - CRM_Core_Payment::BILLING_MODE_BUTTON => 'button', - CRM_Core_Payment::BILLING_MODE_NOTIFY => 'notify', - ); - } - return self::$billingMode; - } /** * Get all the State/Province from database. @@ -852,6 +826,8 @@ WHERE id = %1"; } /** + * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object. + * * Get all permissioned groups from database * * The static array group is returned, and if it's diff --git a/CRM/Financial/BAO/PaymentProcessorType.php b/CRM/Financial/BAO/PaymentProcessorType.php index 14e87df0b213cf10567cd3f06424173734393907..dd37d1f06fd3acea3c3b94d976d52abdb03417b7 100644 --- a/CRM/Financial/BAO/PaymentProcessorType.php +++ b/CRM/Financial/BAO/PaymentProcessorType.php @@ -151,12 +151,12 @@ class CRM_Financial_BAO_PaymentProcessorType extends CRM_Financial_DAO_PaymentPr if (isset($paymentProcessorType->billing_mode)) { // ugh unidirectional manipulation if (!is_numeric($paymentProcessorType->billing_mode)) { - $billingModes = array_flip(CRM_Core_PseudoConstant::billingMode()); + $billingModes = array_flip(CRM_Core_Payment::getBillingModes()); if (array_key_exists($paymentProcessorType->billing_mode, $billingModes)) { $paymentProcessorType->billing_mode = $billingModes[$paymentProcessorType->billing_mode]; } } - if (!array_key_exists($paymentProcessorType->billing_mode, CRM_Core_PseudoConstant::billingMode())) { + if (!array_key_exists($paymentProcessorType->billing_mode, CRM_Core_Payment::getBillingModes())) { throw new Exception("Unrecognized billing_mode"); } }