ILIAS  release_8 Revision v8.24
class.arCalledClassCache.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 $cache = array();
24
25 public static function isCached(string $class_name): bool
26 {
27 return array_key_exists($class_name, self::$cache);
28 }
29
30 public static function store(string $class_name): void
31 {
32 self::$cache[$class_name] = arFactory::getInstance($class_name, null);
33 }
34
35 public static function get(string $class_name): ActiveRecord
36 {
37 if (!self::isCached($class_name)) {
38 self::store($class_name);
39 }
40
41 return self::$cache[$class_name];
42 }
43
44 public static function purge(string $class_name): void
45 {
46 unset(self::$cache[$class_name]);
47 }
48}
Class ActiveRecord.
Class arCalledClassCache.
static purge(string $class_name)
static store(string $class_name)
static isCached(string $class_name)