Skip to content
Snippets Groups Projects
Commit 6e0e6c57 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #3022 from protich/issue/config-items

Config  items cache
parents 5acdf568 5b7292eb
Branches
Tags
No related merge requests found
......@@ -30,6 +30,10 @@ class Config {
# new settings and the corresponding default values.
var $defaults = array(); # List of default values
# Items
var $items = null;
function __construct($section=null, $defaults=array()) {
if ($section)
$this->section = $section;
......@@ -129,16 +133,18 @@ class Config {
function destroy() {
unset($this->session);
return $this->items()->delete();
if ($this->items)
$this->items->delete();
return true;
}
function items() {
static $items;
if (!isset($items))
$items = ConfigItem::items($this->section, $this->section_column);
if (!isset($this->items))
$this->items = ConfigItem::items($this->section, $this->section_column);
return $items;
return $this->items;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment