diff options
author | Morris Jobke <hey@morrisjobke.de> | 2021-03-22 21:48:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-22 21:48:51 +0100 |
commit | 1c074e76028b65c4158097a35254fbf7ebe8749c (patch) | |
tree | cbfa973fdad69df0f06347673575b9481bab09de /lib/public | |
parent | 1eb084cfd37875adfe37301dcef7801634f7e28a (diff) | |
parent | b38618c8139a8017590ea59064184307a93f9808 (diff) | |
download | nextcloud-server-1c074e76028b65c4158097a35254fbf7ebe8749c.tar.gz nextcloud-server-1c074e76028b65c4158097a35254fbf7ebe8749c.zip |
Merge pull request #26198 from nextcloud/unified-search-node
Handle limit offset and sorting in files search
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/Files/Search/ISearchOrder.php | 12 | ||||
-rw-r--r-- | lib/public/Files/Search/ISearchQuery.php | 2 |
2 files changed, 13 insertions, 1 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; } diff --git a/lib/public/Files/Search/ISearchQuery.php b/lib/public/Files/Search/ISearchQuery.php index 4d866f8d7b6..dd7c901f7f5 100644 --- a/lib/public/Files/Search/ISearchQuery.php +++ b/lib/public/Files/Search/ISearchQuery.php @@ -62,7 +62,7 @@ interface ISearchQuery { /** * The user that issued the search * - * @return IUser + * @return ?IUser * @since 12.0.0 */ public function getUser(); |