ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.arConfig.php
Go to the documentation of this file.
1 <?php
2 require_once('./Services/ActiveRecord/class.ActiveRecord.php');
3 
10 class arConfig extends ActiveRecord
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 
76  protected $name;
84  protected $value;
85 
86 
90  public function setName($name)
91  {
92  $this->name = $name;
93  }
94 
95 
99  public function getName()
100  {
101  return $this->name;
102  }
103 
104 
108  public function setValue($value)
109  {
110  $this->value = $value;
111  }
112 
113 
117  public function getValue()
118  {
119  return $this->value;
120  }
121 }
static $cache_loaded
setValue($value)
setName($name)
Class ActiveRecord.
static $cache
Create styles array
The data for the language used.
Class arConfig.
static returnDbTableName()