XOOPS  2.6.0
Registry.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  */
11 
12 namespace Xoops\Core;
13 
27 class Registry extends \ArrayObject implements AttributeInterface
28 {
29 
39  public function get($name, $default = null)
40  {
41  if ($this->offsetExists($name)) {
42  return $this->offsetGet($name);
43  } else {
44  return $default;
45  }
46  }
47 
56  public function set($name, $value)
57  {
58  $this->offsetSet($name, $value);
59  }
60 
68  public function has($name)
69  {
70  return $this->offsetExists($name);
71  }
72 
81  public function remove($name)
82  {
83  $value = null;
84  if ($this->offsetExists($name)) {
85  $value = $this->offsetGet($name);
86  $this->offsetUnset($name);
87  }
88 
89  return $value;
90  }
91 
97  public function clear()
98  {
99  return $this->exchangeArray(array());
100  }
101 }
set($name, $value)
Definition: Registry.php:56