gordonbanderson /
freetextsearch
| 1 | <?php declare(strict_types = 1); |
||
| 2 | |||
| 3 | /** |
||
| 4 | * Created by PhpStorm. |
||
| 5 | * User: gordon |
||
| 6 | * Date: 24/3/2561 |
||
| 7 | * Time: 20:36 น. |
||
| 8 | */ |
||
| 9 | |||
| 10 | namespace Suilven\FreeTextSearch\Container; |
||
| 11 | |||
| 12 | class SuggesterResults |
||
| 13 | { |
||
| 14 | /** @var string */ |
||
| 15 | private $index; |
||
| 16 | |||
| 17 | /** @var string */ |
||
| 18 | private $query; |
||
| 19 | |||
| 20 | /** @var array<string> */ |
||
| 21 | private $results = []; |
||
| 22 | |||
| 23 | /** @var float the time in seconds */ |
||
| 24 | private $time; |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 25 | |||
| 26 | /** @var int */ |
||
| 27 | private $limit; |
||
| 28 | |||
| 29 | |||
| 30 | public function setIndex(string $newIndex): void |
||
| 31 | { |
||
| 32 | $this->index = $newIndex; |
||
| 33 | } |
||
| 34 | |||
| 35 | |||
| 36 | public function setLimit(int $newLimit): void |
||
| 37 | { |
||
| 38 | $this->limit = $newLimit; |
||
| 39 | } |
||
| 40 | |||
| 41 | |||
| 42 | public function setQuery(string $newQuery): void |
||
| 43 | { |
||
| 44 | $this->query = $newQuery; |
||
| 45 | } |
||
| 46 | |||
| 47 | |||
| 48 | /** @return array<string> */ |
||
| 49 | public function getResults(): array |
||
| 50 | { |
||
| 51 | return $this->results; |
||
| 52 | } |
||
| 53 | |||
| 54 | |||
| 55 | /** @param array<string> $newResults */ |
||
| 56 | public function setResults(array $newResults): void |
||
| 57 | { |
||
| 58 | $this->results = $newResults; |
||
| 59 | } |
||
| 60 | } |
||
| 61 |