Commit de79e02781495666839c7c720ad526c8a3a64928

Authored by Neil Blakey-Milner
1 parent e2ae39a2

Use caching for KTPluginEntity::getList/getByNamespace


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5073 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/plugins/pluginentity.inc.php
... ... @@ -50,6 +50,10 @@ class KTPluginEntity extends KTEntity {
50 50 function _table() {
51 51 return KTUtil::getTableName('plugins');
52 52 }
  53 +
  54 + function _cachedGroups() {
  55 + return array('getList', 'getByNamespace');
  56 + }
53 57 // }}}
54 58  
55 59 // {{{ getters/setters
... ... @@ -76,12 +80,14 @@ class KTPluginEntity extends KTEntity {
76 80 // STATIC
77 81 function &getList($sWhereClause = null) {
78 82 global $default;
79   - return KTEntityUtil::getList2('KTPluginEntity', $sWhereClause);
  83 + $aOptions = array('fullselect' => true, 'cache' => 'getList');
  84 + return KTEntityUtil::getList2('KTPluginEntity', $sWhereClause, $aOptions);
80 85 }
81 86  
82 87 // STATIC
83 88 function &getByNamespace($sName) {
84   - return KTEntityUtil::getBy('KTPluginEntity', 'namespace', $sName);
  89 + $aOptions = array('fullselect' => true, 'cache' => 'getByNamespace');
  90 + return KTEntityUtil::getBy('KTPluginEntity', 'namespace', $sName, $aOptions);
85 91 }
86 92  
87 93 function &getEnabledPlugins() {
... ...