ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
57 public static function get(ActiveRecord $ar) {
58 if (!self::isCached($ar)) {
59 self::store($ar);
60 }
61
62 return self::$cache[get_class($ar)];
63 }
64
65
69 public static function purge(ActiveRecord $ar) {
70 unset(self::$cache[get_class($ar)]);
71 }
72
73
79 public static function getPrimaryFieldName(ActiveRecord $ar) {
80 return self::get($ar)->getPrimaryFieldName();
81 }
82
83
89 public static function getPrimaryFieldType(ActiveRecord $ar) {
90 return self::get($ar)->getPrimaryFieldType();
91 }
92}
93
94?>
Class ActiveRecord.
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.