Skip to content

Commit

Permalink
Merge pull request #11563 from eileenmcnaughton/static
Browse files Browse the repository at this point in the history
CRM-21256 Improve performance of payment processor load
  • Loading branch information
eileenmcnaughton authored Jan 25, 2018
2 parents 2084b44 + d09e593 commit bba18c7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CRM/Financial/BAO/PaymentProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,12 @@ public static function getPaymentProcessors($capabilities = array(), $ids = FALS
* @return bool
*/
public static function hasPaymentProcessorSupporting($capabilities = array()) {
$result = self::getPaymentProcessors($capabilities);
return (!empty($result)) ? TRUE : FALSE;
$capabilitiesString = implode('', $capabilities);
if (!isset(\Civi::$statics[__CLASS__]['supported_capabilities'][$capabilitiesString])) {
$result = self::getPaymentProcessors($capabilities);
\Civi::$statics[__CLASS__]['supported_capabilities'][$capabilitiesString] = (!empty($result)) ? TRUE : FALSE;
}
return \Civi::$statics[__CLASS__]['supported_capabilities'][$capabilitiesString];
}

/**
Expand Down

0 comments on commit bba18c7

Please sign in to comment.