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/Model
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2018-01-05 14:56:01 +0300
committerMaxence Lange <maxence@artificial-owl.com>2018-01-05 14:56:01 +0300
commit86fc393ae5025dadcd11815089ec2108d97bb1c4 (patch)
treec376fede4acc948de41ceba0fd9789fcb47142bd /lib/Model
parent2a4b102eee70bcc21ab015acc76c5a80b35692bb (diff)
SearchRequest/author
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Model')
-rw-r--r--lib/Model/SearchRequest.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/Model/SearchRequest.php b/lib/Model/SearchRequest.php
index 4bba3d6..6b123d5 100644
--- a/lib/Model/SearchRequest.php
+++ b/lib/Model/SearchRequest.php
@@ -42,6 +42,8 @@ class SearchRequest implements \JsonSerializable {
/** @var int */
private $size = 10;
+ /** @var string */
+ private $author;
/**
* SearchRequest constructor.
@@ -72,6 +74,21 @@ class SearchRequest implements \JsonSerializable {
/**
* @return string
*/
+ public function getAuthor() {
+ return $this->author;
+ }
+
+ /**
+ * @param string $author
+ */
+ public function setAuthor($author) {
+ $this->author = $author;
+ }
+
+
+ /**
+ * @return string
+ */
public function getSearch() {
return $this->search;
}
@@ -128,6 +145,7 @@ class SearchRequest implements \JsonSerializable {
public function jsonSerialize() {
return [
'providers' => $this->getProviders(),
+ 'author' => $this->getAuthor(),
'search' => $this->getSearch(),
'page' => $this->getPage(),
'size' => $this->getSize()
@@ -152,6 +170,7 @@ class SearchRequest implements \JsonSerializable {
public static function fromArray($arr) {
$request = new SearchRequest();
$request->setProviders($arr['providers']);
+ $request->setAuthor($arr['author']);
$request->setSearch(MiscService::get($arr, 'search', ''));
$request->setPage(MiscService::get($arr, 'page', 0));
$request->setSize(MiscService::get($arr, 'size', 10));