1 | <?php |
||
13 | abstract class AbstractSearch implements SearchInterface, LoggerAwareInterface |
||
14 | { |
||
15 | use LoggerAwareTrait; |
||
16 | |||
17 | /** |
||
18 | * The (raw) search results. |
||
19 | * @var array $results |
||
20 | */ |
||
21 | private $results; |
||
22 | |||
23 | /** |
||
24 | * [$modelFactory description] |
||
25 | * @var [type] |
||
26 | */ |
||
27 | protected $modelFactory; |
||
28 | |||
29 | |||
30 | /** |
||
31 | * @param array $data Class options and dependencies. |
||
32 | */ |
||
33 | public function __construct(array $data) |
||
38 | |||
39 | /** |
||
40 | * [setModelFactory description] |
||
41 | * @param [type] $factory [description] |
||
|
|||
42 | */ |
||
43 | public function setModelFactory($factory) |
||
48 | |||
49 | /** |
||
50 | * [modelFactory description] |
||
51 | * @return [type] [description] |
||
52 | */ |
||
53 | public function modelFactory() |
||
57 | |||
58 | /** |
||
59 | * @param string $keyword The searched-for keyword. |
||
60 | * @return array |
||
61 | */ |
||
62 | abstract public function search($keyword); |
||
63 | |||
64 | /** |
||
65 | * A search is always callable (alias to the "search" method). |
||
66 | * |
||
67 | * @param string $keyword The searched-for keyword. |
||
68 | * @return array The results. |
||
69 | */ |
||
70 | final public function __invoke($keyword) |
||
74 | |||
75 | /** |
||
76 | * @param string $resultType The type of results to search. Can be only "raw" for now. |
||
77 | * @throws RuntimeException If this method is called before a search was executed. |
||
78 | * @return array The results from the last search operation. |
||
79 | */ |
||
80 | final public function lastResults($resultType = 'raw') |
||
92 | |||
93 | /** |
||
94 | * @param array $results The (raw) search results. |
||
95 | * @return void |
||
96 | */ |
||
97 | final protected function setResults(array $results) |
||
101 | } |
||
102 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.