diff options
author | Robin Appelman <robin@icewind.nl> | 2021-03-19 14:26:44 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2021-03-23 13:41:18 +0000 |
commit | d4381c0eac568273367389985565a52c28e1dcfe (patch) | |
tree | 88ce90c347d7a1031370703c571846c06c2dc434 /lib/public/Files/Search | |
parent | 8551ee079dfcc49c85ecea3a042077dc85790c67 (diff) | |
download | nextcloud-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.php | 12 |
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; } |