ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.arCalledClassCache.php
Go to the documentation of this file.
1<?php
2
25{
26 protected static array $cache = [];
27
28 public static function isCached(string $class_name): bool
29 {
30 return array_key_exists($class_name, self::$cache);
31 }
32
33 public static function store(string $class_name): void
34 {
35 self::$cache[$class_name] = arFactory::getInstance($class_name, null);
36 }
37
38 public static function get(string $class_name): ActiveRecord
39 {
40 if (!self::isCached($class_name)) {
41 self::store($class_name);
42 }
43
44 return self::$cache[$class_name];
45 }
46
47 public static function purge(string $class_name): void
48 {
49 unset(self::$cache[$class_name]);
50 }
51}
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...
static purge(string $class_name)
static store(string $class_name)
static isCached(string $class_name)