summaryrefslogtreecommitdiffstats
path: root/lib/public/Files/Search
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2021-03-19 14:26:44 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-03-23 13:41:18 +0000
commitd4381c0eac568273367389985565a52c28e1dcfe (patch)
tree88ce90c347d7a1031370703c571846c06c2dc434 /lib/public/Files/Search
parent8551ee079dfcc49c85ecea3a042077dc85790c67 (diff)
downloadnextcloud-server-d4381c0eac568273367389985565a52c28e1dcfe.tar.gz
nextcloud-server-d4381c0eac568273367389985565a52c28e1dcfe.zip
handle ordering in folder search
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/public/Files/Search')
-rw-r--r--lib/public/Files/Search/ISearchOrder.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/public/Files/Search/ISearchOrder.php b/lib/public/Files/Search/ISearchOrder.php
index fb0137c1bac..8237b1861ea 100644
--- a/lib/public/Files/Search/ISearchOrder.php
+++ b/lib/public/Files/Search/ISearchOrder.php
@@ -24,6 +24,8 @@
namespace OCP\Files\Search;
+use OCP\Files\FileInfo;
+
/**
* @since 12.0.0
*/
@@ -46,4 +48,14 @@ interface ISearchOrder {
* @since 12.0.0
*/
public function getField();
+
+ /**
+ * Apply the sorting on 2 FileInfo objects
+ *
+ * @param FileInfo $a
+ * @param FileInfo $b
+ * @return int -1 if $a < $b, 0 if $a = $b, 1 if $a > $b (for ascending, reverse for descending)
+ * @since 22.0.0
+ */
+ public function sortFileInfo(FileInfo $a, FileInfo $b): int;
}