Skip to content
Snippets Groups Projects
Commit fb5faaf4 authored by Laurent's avatar Laurent
Browse files

dev #40971 Nanook is multi SIGB

parent a75a4842
Branches
Tags
3 merge requests!2334Master,!2178Dev#40971 pouvoir prendre l email comme identifiant alternatif cctp agglo2b,!2174Dev#40971 pouvoir prendre l email comme identifiant alternatif cctp agglo2b
Pipeline #1571 failed with stage
in 13 minutes and 33 seconds
......@@ -19,20 +19,27 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_WebService_SIGB_Nanook extends Class_WebService_SIGB_Abstract {
protected static $services = [];
public static function makeKey($params) {
return md5(serialize($params));
}
public static function getService($params){
if (!isset($params['provide_suggest']))
$params = array_merge(['provide_suggest' => ''],
$params);
if (!isset(static::$service)) {
$key = static::makeKey($params);
if (!isset(static::$services[$key])) {
$instance = new static();
$classname = get_called_class().'_Service';
static::$service = $classname::getService($params['url_serveur'],
$params['provide_suggest'] === '1');
$service = $classname::getService($params['url_serveur'],
$params['provide_suggest'] === '1');
static::$services[$key] = $service;
}
return static::$service;
return static::$services[$key];
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment