aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Search
diff options
context:
space:
mode:
authorBenjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>2023-11-21 17:24:36 +0100
committerBenjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>2023-11-22 08:47:53 +0100
commit75e5854458d60e220f7989dc8290f9c570645dd2 (patch)
treea92484deab1a571d6c1f90b6dbce086240f4c280 /lib/public/Search
parente1d3fb53bc8b2c378fc1cc020af802910e6d6f78 (diff)
downloadnextcloud-server-75e5854458d60e220f7989dc8290f9c570645dd2.tar.gz
nextcloud-server-75e5854458d60e220f7989dc8290f9c570645dd2.zip
feat(search): hide search provider
Some search providers can be hidden if they send `null` in `getOrder` Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Diffstat (limited to 'lib/public/Search')
-rw-r--r--lib/public/Search/IProvider.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/public/Search/IProvider.php b/lib/public/Search/IProvider.php
index 61655c47367..95d7a1b163a 100644
--- a/lib/public/Search/IProvider.php
+++ b/lib/public/Search/IProvider.php
@@ -68,15 +68,17 @@ interface IProvider {
/**
* Get the search provider order
* The lower the int, the higher it will be sorted (0 will be before 10)
+ * If null, the search provider will be hidden in the UI and the API not called
*
* @param string $route the route the user is currently at, e.g. files.view.index
* @param array $routeParameters the parameters of the route the user is currently at, e.g. [fileId = 982, dir = "/"]
*
- * @return int
+ * @return int|null
*
* @since 20.0.0
+ * @since 28.0.0 Can return null
*/
- public function getOrder(string $route, array $routeParameters): int;
+ public function getOrder(string $route, array $routeParameters): ?int;
/**
* Find matching search entries in an app