Merge pull request #15035 from nextcloud/enhancement/noid/add-isavailable-to-fulltextsearchmanager
[nc16] Add a bool check isAvailable() to FullTextSearchManager
This commit is contained in:
commit
99f7e7c53d
|
@ -85,6 +85,21 @@ class FullTextSearchManager implements IFullTextSearchManager {
|
||||||
$this->searchService = $searchService;
|
$this->searchService = $searchService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 16.0.0
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isAvailable(): bool {
|
||||||
|
if ($this->indexService === null ||
|
||||||
|
$this->providerService === null ||
|
||||||
|
$this->searchService === null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return IProviderService
|
* @return IProviderService
|
||||||
|
|
|
@ -78,6 +78,16 @@ interface IFullTextSearchManager {
|
||||||
*/
|
*/
|
||||||
public function registerSearchService(ISearchService $searchService);
|
public function registerSearchService(ISearchService $searchService);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns true is Full Text Search is available (app is present and Service
|
||||||
|
* are registered)
|
||||||
|
*
|
||||||
|
* @since 16.0.0
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isAvailable(): bool;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the Javascript API in the navigation page of an app.
|
* Add the Javascript API in the navigation page of an app.
|
||||||
|
|
Loading…
Reference in New Issue