Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/fulltextsearch.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2018-07-27 13:07:16 +0300
committerMaxence Lange <maxence@artificial-owl.com>2018-07-27 13:07:16 +0300
commit4618b018bf53906a5670e7fc2f461f1b8f390892 (patch)
tree330f7dbb9ac48e1d7ce3d6802d7dba7f9525e733 /lib
parent665530336392412487b1dc74155bf2de29f7e979 (diff)
bugfix
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Db/IndexesRequest.php2
-rw-r--r--lib/Model/SearchResult.php33
2 files changed, 22 insertions, 13 deletions
diff --git a/lib/Db/IndexesRequest.php b/lib/Db/IndexesRequest.php
index f448d29..b2e9574 100644
--- a/lib/Db/IndexesRequest.php
+++ b/lib/Db/IndexesRequest.php
@@ -129,7 +129,7 @@ class IndexesRequest extends IndexesRequestBuilder {
*/
public function deleteFromProviderId($providerId) {
$qb = $this->getIndexesDeleteSql();
- $this->limitToProviderId($qb, $providerId());
+ $this->limitToProviderId($qb, $providerId);
$qb->execute();
}
diff --git a/lib/Model/SearchResult.php b/lib/Model/SearchResult.php
index 435823b..580d5df 100644
--- a/lib/Model/SearchResult.php
+++ b/lib/Model/SearchResult.php
@@ -225,20 +225,29 @@ class SearchResult implements \JsonSerializable {
*/
public function jsonSerialize() {
- $provider = $this->getProvider();
- $platform = $this->getPlatform();
+ $providerObj = $this->getProvider();
+ $provider = [];
+ if ($providerObj !== null) {
+ $provider = [
+ 'id' => $providerObj->getId(),
+ 'name' => $providerObj->getName(),
+ 'version' => $providerObj->getVersion()
+ ];
+ }
+
+ $platformObj = $this->getPlatform();
+ $platform = [];
+ if ($platformObj !== null) {
+ $platform = [
+ 'id' => $platformObj->getId(),
+ 'name' => $platformObj->getName(),
+ 'version' => $platformObj->getVersion()
+ ];
+ }
return [
- 'provider' => [
- 'id' => $provider->getId(),
- 'name' => $provider->getName(),
- 'version' => $provider->getVersion()
- ],
- 'platform' => [
- 'id' => $platform->getId(),
- 'name' => $platform->getName(),
- 'version' => $platform->getVersion()
- ],
+ 'provider' => $provider,
+ 'platform' => $platform,
'documents' => $this->getDocuments(),
'meta' =>
[