searchService = $searchService; $this->l10n = $l10n; } public function getId(): string { return 'search-deck-comment'; } public function getName(): string { return $this->l10n->t('Card comments'); } public function search(IUser $user, ISearchQuery $query): SearchResult { $cursor = $query->getCursor() !== null ? (int)$query->getCursor() : null; $results = $this->searchService->searchComments($query->getTerm(), $query->getLimit(), $cursor); if (count($results) < $query->getLimit()) { return SearchResult::complete( $this->l10n->t('Card comments'), $results ); } return SearchResult::paginated( $this->l10n->t('Card comments'), $results, $results[count($results) - 1]->getCommentId() ); } public function getOrder(string $route, array $routeParameters): int { // Negative value to force showing deck providers on first position if the app is opened // This provider always has an order 1 higher than the default DeckProvider if ($route === 'deck.Page.index') { return -4; } return 11; } }