ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.arConfig.php
Go to the documentation of this file.
1<?php
2require_once('./Services/ActiveRecord/class.ActiveRecord.php');
3
11{
12
17 public static function returnDbTableName()
18 {
19 return 'ar_demo_config';
20 }
21
22
26 protected static $cache = array();
30 protected static $cache_loaded = array();
31
32
38 public static function get($name)
39 {
40 if (!self::$cache_loaded[$name]) {
41 $obj = new self($name);
42 self::$cache[$name] = $obj->getValue();
43 self::$cache_loaded[$name] = true;
44 }
45
46 return self::$cache[$name];
47 }
48
49
54 public static function set($name, $value)
55 {
56 $obj = new self($name);
57 $obj->setValue($value);
58 if (self::where(array( 'name' => $name ))->hasSets()) {
59 $obj->update();
60 } else {
61 $obj->create();
62 }
63 }
64
65
75 protected $name;
83 protected $value;
84
85
89 public function setName($name)
90 {
91 $this->name = $name;
92 }
93
94
98 public function getName()
99 {
100 return $this->name;
101 }
102
103
107 public function setValue($value)
108 {
109 $this->value = $value;
110 }
111
112
116 public function getValue()
117 {
118 return $this->value;
119 }
120}
Class ActiveRecord.
An exception for terminatinating execution or to throw for unit testing.
Class arConfig.
setName($name)
static $cache
static returnDbTableName()
static $cache_loaded
setValue($value)