ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
class.arConnectorMap.php
Go to the documentation of this file.
1 <?php
2 
25 {
26  protected static array $map = [];
27 
28  public static function register(ActiveRecord $activeRecord, arConnector $arConnector): void
29  {
30  self::$map[$activeRecord::class] = $arConnector;
31  }
32 
33  public static function get(ActiveRecord $activeRecord): \arConnector
34  {
35  if (!isset(self::$map[$activeRecord::class])) {
36  return new arConnectorDB();
37  }
38  if (!self::$map[$activeRecord::class] instanceof arConnector) {
39  return new arConnectorDB();
40  }
41  return self::$map[$activeRecord::class];
42  }
43 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...