XOOPS Cube Legacy base repository
Revision | 68780a2968105a518eecaa98da60d72b197f2f9d (tree) |
---|---|
Time | 2011-11-03 19:30:08 |
Author | nbuy <nbuy@704c...> |
Commiter | nbuy |
XoopsObject extents constractor cachce for speedup
git-svn-id: https://xoopscube.svn.sourceforge.net/svnroot/xoopscube/Package_Legacy/trunk@1035 704cf05f-ae62-4b0e-a484-234ee0250e75
@@ -47,11 +47,17 @@ class XoopsGroup extends XoopsObject | ||
47 | 47 | */ |
48 | 48 | function XoopsGroup() |
49 | 49 | { |
50 | + static $initVars; | |
51 | + if (isset($initVars)) { | |
52 | + $this->vars = $initVars; | |
53 | + return; | |
54 | + } | |
50 | 55 | $this->XoopsObject(); |
51 | 56 | $this->initVar('groupid', XOBJ_DTYPE_INT, null, false); |
52 | 57 | $this->initVar('name', XOBJ_DTYPE_TXTBOX, null, true, 100); |
53 | 58 | $this->initVar('description', XOBJ_DTYPE_TXTAREA, null, false); |
54 | 59 | $this->initVar('group_type', XOBJ_DTYPE_OTHER, null, false); |
60 | + $initVars = $this->vars; | |
55 | 61 | } |
56 | 62 | } |
57 | 63 |
@@ -65,12 +65,18 @@ class XoopsGroupPerm extends XoopsObject | ||
65 | 65 | */ |
66 | 66 | function XoopsGroupPerm() |
67 | 67 | { |
68 | + static $initVars; | |
69 | + if (isset($initVars)) { | |
70 | + $this->vars = $initVars; | |
71 | + return; | |
72 | + } | |
68 | 73 | $this->XoopsObject(); |
69 | 74 | $this->initVar('gperm_id', XOBJ_DTYPE_INT, null, false); |
70 | 75 | $this->initVar('gperm_groupid', XOBJ_DTYPE_INT, null, false); |
71 | 76 | $this->initVar('gperm_itemid', XOBJ_DTYPE_INT, null, false); |
72 | 77 | $this->initVar('gperm_modid', XOBJ_DTYPE_INT, 0, false); |
73 | 78 | $this->initVar('gperm_name', XOBJ_DTYPE_OTHER, null, false); |
79 | + $initVars = $this->vars; | |
74 | 80 | } |
75 | 81 | |
76 | 82 | function cleanVars() |