ILIAS  release_8 Revision v8.24
class.arConnectorMap.php
Go to the documentation of this file.
1<?php
2
3/******************************************************************************
4 *
5 * This file is part of ILIAS, a powerful learning management system.
6 *
7 * ILIAS is licensed with the GPL-3.0, you should have received a copy
8 * of said license along with the source code.
9 *
10 * If this is not the case or you just want to try ILIAS, you'll find
11 * us at:
12 * https://www.ilias.de
13 * https://github.com/ILIAS-eLearning
14 *
15 *****************************************************************************/
22{
23 protected static array $map = array();
24
25 public static function register(ActiveRecord $ar, arConnector $connector): void
26 {
27 self::$map[get_class($ar)] = $connector;
28 }
29
30 public static function get(ActiveRecord $ar): \arConnector
31 {
32 if (isset(self::$map[get_class($ar)]) && self::$map[get_class($ar)] instanceof arConnector) {
33 return self::$map[get_class($ar)];
34 }
35
36 return new arConnectorDB();
37 }
38}
Class ActiveRecord.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class arConnectorMap.
Class arConnector.