1 | <?php |
||
28 | class SearchController extends Controller { |
||
29 | |||
30 | /** |
||
31 | * Maximum number of suggestions which should be provided by the autocomplete action |
||
32 | * |
||
33 | * @var integer |
||
34 | */ |
||
35 | const SUGGESTION_COUNT = 10; |
||
36 | |||
37 | /** |
||
38 | * Prefix to store information in the session variable |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | const SESSION_PREFIX = 'stinger_soft_entity_search'; |
||
43 | |||
44 | /** |
||
45 | * Number of results which should be displayed per page |
||
46 | * |
||
47 | * @var integer |
||
48 | */ |
||
49 | const RESULTS_PER_PAGE = 10; |
||
50 | |||
51 | /** |
||
52 | * |
||
53 | * @var SearchService |
||
54 | */ |
||
55 | private $searchService; |
||
|
|||
56 | |||
57 | public function searchAction(Request $request) { |
||
105 | |||
106 | protected function getFacetFormatter() { |
||
109 | |||
110 | /** |
||
111 | * Returns an array of preselected facets (no facet selected is the default) |
||
112 | * |
||
113 | * @return string[string][] |
||
114 | */ |
||
115 | protected function getDefaultFacets() { |
||
119 | |||
120 | /** |
||
121 | * Returns an array of the available facets which should be offered the user as a filter |
||
122 | * |
||
123 | * @return string[] |
||
124 | */ |
||
125 | protected function getAvailableFacets() { |
||
132 | |||
133 | /** |
||
134 | * Fetches the searched facets from the session object |
||
135 | * |
||
136 | * @param SessionInterface $session |
||
137 | * @return string[string][] |
||
138 | */ |
||
139 | protected function getSearchFacets(SessionInterface $session) { |
||
143 | |||
144 | protected function setSearchFacets(SessionInterface $session, $facets) { |
||
146 | |||
147 | /** |
||
148 | * Fetches the search term from the session object |
||
149 | * |
||
150 | * @param SessionInterface $session |
||
151 | * @return mixed |
||
152 | */ |
||
153 | protected function getSearchTerm(SessionInterface $session) { |
||
156 | |||
157 | /** |
||
158 | * Sets the given search term in the user's session |
||
159 | * |
||
160 | * @param SessionInterface $session |
||
161 | * @param string $term |
||
162 | */ |
||
163 | protected function setSearchTerm(SessionInterface $session, $term) { |
||
166 | |||
167 | /** |
||
168 | * Returns a JSON array of autocompletions for the given term. |
||
169 | * The term can be provided as a GET or POST paramater with the name <em>term</em> |
||
170 | * |
||
171 | * @param Request $request |
||
172 | * @return \Symfony\Component\HttpFoundation\JsonResponse |
||
173 | */ |
||
174 | public function autocompleteAction(Request $request) { |
||
178 | |||
179 | /** |
||
180 | * Provides an online help for the configured search service. |
||
181 | * If the search service has no online help defined a warning message will be displayed to the user. |
||
182 | * |
||
183 | * @param Request $request |
||
184 | * @return \Symfony\Component\HttpFoundation\Response |
||
185 | */ |
||
186 | public function onlineHelpAction(Request $request) { |
||
190 | |||
191 | /** |
||
192 | * Inits and returns the configured search service |
||
193 | * |
||
194 | * @return SearchService |
||
195 | */ |
||
196 | protected function getSearchService() { |
||
201 | } |
This check marks private properties in classes that are never used. Those properties can be removed.