summaryrefslogtreecommitdiff
path: root/plugins/libkolab/lib/kolab_storage_config.php
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-08-19 09:10:31 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2014-08-19 09:11:18 (GMT)
commite3d29617ae5a0f72efca8f08b5c3f57af6cb4c26 (patch)
tree126b79f71ba87c36f7bc228ae12f0d4b1f302552 /plugins/libkolab/lib/kolab_storage_config.php
parentafed2435d7de81defe006f3bc7f327ddfb2aadcf (diff)
downloadroundcubemail-plugins-kolab-e3d29617ae5a0f72efca8f08b5c3f57af6cb4c26.tar.gz
Query kolab_cache_configuration with category filter for better performance (#3286)
Warning: this requires DELETE FROM kolab_folders WHERE type = 'configuration';
Diffstat (limited to 'plugins/libkolab/lib/kolab_storage_config.php')
-rw-r--r--plugins/libkolab/lib/kolab_storage_config.php25
1 files changed, 10 insertions, 15 deletions
diff --git a/plugins/libkolab/lib/kolab_storage_config.php b/plugins/libkolab/lib/kolab_storage_config.php
index a80cf46..beaa928 100644
--- a/plugins/libkolab/lib/kolab_storage_config.php
+++ b/plugins/libkolab/lib/kolab_storage_config.php
@@ -103,14 +103,13 @@ class kolab_storage_config
/**
* Get configuration objects
*
- * @param array $filter Search filter
- * @param bool $default Enable to get objects only from default folder
- * @param array $data_filter Additional object data filter
- * @param int $limit Max. number of records (per-folder)
+ * @param array $filter Search filter
+ * @param bool $default Enable to get objects only from default folder
+ * @param int $limit Max. number of records (per-folder)
*
* @return array List of objects
*/
- public function get_objects($filter = array(), $default = false, $data_filter = array(), $limit = 0)
+ public function get_objects($filter = array(), $default = false, $limit = 0)
{
$list = array();
@@ -126,12 +125,6 @@ class kolab_storage_config
}
foreach ($folder->select($filter) as $object) {
- foreach ($data_filter as $key => $val) {
- if ($object[$key] != $val) {
- continue 2;
- }
- }
-
$list[] = $object;
}
}
@@ -624,11 +617,13 @@ class kolab_storage_config
public function get_tags($uid = '*')
{
if (!isset($this->tags)) {
- $filter = array(array('type', '=', 'relation'));
- $default = true;
- $data_filter = array('category' => 'tag');
+ $default = true;
+ $filter = array(
+ array('type', '=', 'relation'),
+ array('category', '=', 'tag')
+ );
- $this->tags = $this->get_objects($filter, $default, $data_filter);
+ $this->tags = $this->get_objects($filter, $default);
}
if ($uid === '*') {