l10n->t('Polls'); } public function search(IUser $user, ISearchQuery $query): SearchResult { $polls = $this->pollService->search($query); $results = array_map(function (Poll $poll) { return [ 'object' => $poll, 'entry' => new PollsSearchResultEntry($poll) ]; }, $polls); $resultEntries = array_map(function (array $result) { return $result['entry']; }, $results); return SearchResult::complete( $this->l10n->t('Polls'), $resultEntries ); } public function getOrder(string $route, array $routeParameters): int { if (in_array(strtolower($route), [AppConstants::APP_ID . '.page.index', AppConstants::APP_ID . '.page.vote'])) { return -5; } return 51; } }