ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.arFieldCache.php
Go to the documentation of this file.
1<?php
2require_once(dirname(__FILE__) . '/../Fields/class.arFieldList.php');
3
12
16 protected static $cache = array();
17
18
24 public static function isCached(ActiveRecord $ar) {
25 return in_array(get_class($ar), array_keys(self::$cache));
26 }
27
28
32 public static function store(ActiveRecord $ar) {
33 self::$cache[get_class($ar)] = arFieldList::getInstance($ar);
34 }
35
36
44 public static function storeFromStorage($storage_class_name, arStorageInterface $foreign_model) {
45 self::$cache[$storage_class_name] = arFieldList::getInstanceFromStorage($foreign_model);
46 }
47
48
54 public static function get(ActiveRecord $ar) {
55 if (!self::isCached($ar)) {
56 self::store($ar);
57 }
58
59 return self::$cache[get_class($ar)];
60 }
61
62
66 public static function purge(ActiveRecord $ar) {
67 unset(self::$cache[get_class($ar)]);
68 }
69
70
76 public static function getPrimaryFieldName(ActiveRecord $ar) {
77 return self::get($ar)->getPrimaryFieldName();
78 }
79
80
86 public static function getPrimaryFieldType(ActiveRecord $ar) {
87 return self::get($ar)->getPrimaryFieldType();
88 }
89}
90
91?>
Class ActiveRecord.
An exception for terminatinating execution or to throw for unit testing.
Class arFieldCache.
static getPrimaryFieldName(ActiveRecord $ar)
static get(ActiveRecord $ar)
static isCached(ActiveRecord $ar)
static store(ActiveRecord $ar)
static purge(ActiveRecord $ar)
static storeFromStorage($storage_class_name, arStorageInterface $foreign_model)
static getPrimaryFieldType(ActiveRecord $ar)
static getInstanceFromStorage($ar)
static getInstance(ActiveRecord $ar)
Class arStorageInterface.