From 3128758a9172ea9e26dfd257504ab2ea86e10d70 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Fri, 19 Jan 2018 22:23:11 -0100 Subject: display version in searchresult Signed-off-by: Maxence Lange --- lib/Model/SearchResult.php | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'lib/Model') diff --git a/lib/Model/SearchResult.php b/lib/Model/SearchResult.php index c070187..435823b 100644 --- a/lib/Model/SearchResult.php +++ b/lib/Model/SearchResult.php @@ -26,6 +26,7 @@ namespace OCA\FullTextSearch\Model; +use OCA\FullTextSearch\IFullTextSearchPlatform; use OCA\FullTextSearch\IFullTextSearchProvider; class SearchResult implements \JsonSerializable { @@ -39,6 +40,9 @@ class SearchResult implements \JsonSerializable { /** @var IFullTextSearchProvider */ private $provider; + /** @var IFullTextSearchPlatform */ + private $platform; + /** @var int */ private $total; @@ -126,6 +130,21 @@ class SearchResult implements \JsonSerializable { } + /** + * @return IFullTextSearchPlatform + */ + public function getPlatform() { + return $this->platform; + } + + /** + * @param IFullTextSearchPlatform $platform + */ + public function setPlatform($platform) { + $this->platform = $platform; + } + + /** * @return int */ @@ -207,11 +226,18 @@ class SearchResult implements \JsonSerializable { public function jsonSerialize() { $provider = $this->getProvider(); + $platform = $this->getPlatform(); return [ 'provider' => [ - 'id' => $provider->getId(), - 'name' => $provider->getName() + 'id' => $provider->getId(), + 'name' => $provider->getName(), + 'version' => $provider->getVersion() + ], + 'platform' => [ + 'id' => $platform->getId(), + 'name' => $platform->getName(), + 'version' => $platform->getVersion() ], 'documents' => $this->getDocuments(), 'meta' => -- cgit v1.2.3