summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_result_multifolder.php
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-04-08 10:58:56 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-04-08 10:58:56 +0200
commit188304872066eef4b20c305f9cd6ea939dd419e0 (patch)
tree6dcf6daf1b3a970b99ddf60cc650b9c541e2e242 /program/lib/Roundcube/rcube_result_multifolder.php
parent518963d1d4456afa6f044731e2127d488f68bb16 (diff)
Optimize header fetching of multi-folder searches with natural (UID) sorting
Diffstat (limited to 'program/lib/Roundcube/rcube_result_multifolder.php')
-rw-r--r--program/lib/Roundcube/rcube_result_multifolder.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/program/lib/Roundcube/rcube_result_multifolder.php b/program/lib/Roundcube/rcube_result_multifolder.php
index ac0889526..74a3d7805 100644
--- a/program/lib/Roundcube/rcube_result_multifolder.php
+++ b/program/lib/Roundcube/rcube_result_multifolder.php
@@ -169,6 +169,21 @@ class rcube_result_multifolder
}
/**
+ * Slices data set.
+ *
+ * @param $offset Offset (as for PHP's array_slice())
+ * @param $length Number of elements (as for PHP's array_slice())
+ *
+ */
+ public function slice($offset, $length)
+ {
+ $data = array_slice($this->get(), $offset, $length);
+
+ $this->index = $data;
+ $this->meta['count'] = count($data);
+ }
+
+ /**
* Filters data set. Removes elements not listed in $ids list.
*
* @param array $ids List of IDs to keep.