ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
Memory.php
Go to the documentation of this file.
1 <?php
2 
10 {
11 
12  protected $definitions;
13  public $name = 'Memory';
14 
15  public function copy() {
17  }
18 
19  public function add($def, $config) {
20  $status = parent::add($def, $config);
21  if ($status) $this->definitions[$this->generateKey($config)] = $def;
22  return $status;
23  }
24 
25  public function set($def, $config) {
26  $status = parent::set($def, $config);
27  if ($status) $this->definitions[$this->generateKey($config)] = $def;
28  return $status;
29  }
30 
31  public function replace($def, $config) {
32  $status = parent::replace($def, $config);
33  if ($status) $this->definitions[$this->generateKey($config)] = $def;
34  return $status;
35  }
36 
37  public function get($config) {
38  $key = $this->generateKey($config);
39  if (isset($this->definitions[$key])) return $this->definitions[$key];
40  $this->definitions[$key] = parent::get($config);
41  return $this->definitions[$key];
42  }
43 
44 }
45 
46 // vim: et sw=4 sts=4