summaryrefslogtreecommitdiff
path: root/plugins/libkolab/lib/kolab_storage_cache_configuration.php
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-08-26 10:03:11 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-08-26 10:03:11 (GMT)
commit54b6eb66decf1828c8217db6e2b90bcf16c49eb9 (patch)
tree6db29e61636826a01ec5ec737a8c122b5429cf20 /plugins/libkolab/lib/kolab_storage_cache_configuration.php
parent43d3f854482b257fdbf364e59dacdc4609b92557 (diff)
downloadroundcubemail-plugins-kolab-54b6eb66decf1828c8217db6e2b90bcf16c49eb9.tar.gz
Post-filter all tag objects (in case caching is disabled); improve kolab_storage_cache for the case caching is off
Diffstat (limited to 'plugins/libkolab/lib/kolab_storage_cache_configuration.php')
-rw-r--r--plugins/libkolab/lib/kolab_storage_cache_configuration.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/libkolab/lib/kolab_storage_cache_configuration.php b/plugins/libkolab/lib/kolab_storage_cache_configuration.php
index ec015dd..c3c7ac4 100644
--- a/plugins/libkolab/lib/kolab_storage_cache_configuration.php
+++ b/plugins/libkolab/lib/kolab_storage_cache_configuration.php
@@ -39,6 +39,28 @@ class kolab_storage_cache_configuration extends kolab_storage_cache
}
/**
+ * Select Kolab objects filtered by the given query
+ *
+ * @param array Pseudo-SQL query as list of filter parameter triplets
+ * @param boolean Set true to only return UIDs instead of complete objects
+ * @return array List of Kolab data objects (each represented as hash array) or UIDs
+ */
+ public function select($query = array(), $uids = false)
+ {
+ // modify query for IMAP search: query param 'type' is actually a subtype
+ if (!$this->ready) {
+ foreach ($query as $i => $tuple) {
+ if ($tuple[0] == 'type') {
+ $tuple[2] = 'configuration.' . $tuple[2];
+ $query[$i] = $tuple;
+ }
+ }
+ }
+
+ return parent::select($query, $uids);
+ }
+
+ /**
* Helper method to compose a valid SQL query from pseudo filter triplets
*/
protected function _sql_where($query)