if (empty($paymentProcessor)) {
return CRM_Core_DAO::$_nullObject;
}
- Civi\Payment\System::singleton()->getByProcessor($paymentProcessor);
+ //we use two lines because we can't remove the '&singleton' without risking breakage
+ //of extension classes that extend this one
+ $object = Civi\Payment\System::singleton()->getByProcessor($paymentProcessor);
+ return $object;
}
/**
/**
* @var array cache
*/
- private static $cache = array();
+ private $cache = array();
/**
* @return \Civi\Payment\System
public function getByProcessor($processor) {
$id = $processor['id'];
- if (!isset(self::$cache[$id])) {
- if (!isset(self::$cache[$id])) {
+ if (!isset($this->cache[$id])) {
+ if (!isset($this->cache[$id])) {
//does this config need to be called?
$config = \CRM_Core_Config::singleton();
$ext = \CRM_Extension_System::singleton()->getMapper();
require_once str_replace('_', DIRECTORY_SEPARATOR, $paymentClass) . '.php';
}
- self::$cache[$id] = new $paymentClass($processor['is_test'] ? 'test' : 'live', $processor);
+ $this->cache[$id] = new $paymentClass($processor['is_test'] ? 'test' : 'live', $processor);
}
}
- return self::$cache[$id];
+ return $this->cache[$id];
}
/**
* @param integer $id