summaryrefslogtreecommitdiff
path: root/plugins/libkolab/lib/kolab_storage_cache_configuration.php
diff options
context:
space:
mode:
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, 21 insertions, 1 deletions
diff --git a/plugins/libkolab/lib/kolab_storage_cache_configuration.php b/plugins/libkolab/lib/kolab_storage_cache_configuration.php
index 8380aa8..97315da 100644
--- a/plugins/libkolab/lib/kolab_storage_cache_configuration.php
+++ b/plugins/libkolab/lib/kolab_storage_cache_configuration.php
@@ -37,4 +37,24 @@ class kolab_storage_cache_configuration extends kolab_storage_cache
return $sql_data;
}
-} \ No newline at end of file
+
+ /**
+ * Helper method to compose a valid SQL query from pseudo filter triplets
+ */
+ protected function _sql_where($query)
+ {
+ if (is_array($query)) {
+ foreach ($query as $idx => $param) {
+ // convert category filter
+ if ($param[0] == 'category') {
+ $param[2] = array_map(function($n) { return 'category:' . $n; }, (array) $param[2]);
+
+ $query[$idx][0] = 'tags';
+ $query[$idx][2] = count($param[2]) > 1 ? $param[2] : $param[2][0];
+ }
+ }
+ }
+
+ return parent::_sql_where($query);
+ }
+}