diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2019-07-18 01:34:26 +0300 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2019-07-18 01:34:26 +0300 |
commit | 167f4c4b9399fc61987c86e8c1a8d184a806420e (patch) | |
tree | dafaa59b807d10d657dd552972871da36e2c7f8e /lib/Model | |
parent | 00144e7f01310be85e9e1d212dca7e3fadb39a7a (diff) |
1.3.5
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Model')
-rw-r--r-- | lib/Model/SearchRequest.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/Model/SearchRequest.php b/lib/Model/SearchRequest.php index 3a4d819..1c4fe43 100644 --- a/lib/Model/SearchRequest.php +++ b/lib/Model/SearchRequest.php @@ -163,6 +163,17 @@ class SearchRequest implements ISearchRequest, JsonSerializable { return $this; } + /** + * @param string $search + * + * @return ISearchRequest + */ + public function addSearch(string $search): ISearchRequest { + $this->search .= ' ' . $search; + + return $this; + } + /** * @@ -192,7 +203,7 @@ class SearchRequest implements ISearchRequest, JsonSerializable { * @return bool */ private function searchQueryOptions(string $word): bool { - if (($pos = strpos($word, ':')) === false) { + if (($pos = strpos($word, ':')) === false || $pos === 0) { return false; } |