Implement new unified search API

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-08-17 17:13:17 +02:00
parent 45c5b1678b
commit 2059e55e30
5 changed files with 186 additions and 6 deletions

View File

@@ -28,11 +28,13 @@ namespace OCA\Deck\Search;
use OCA\Deck\Db\Board;
use OCA\Deck\Db\Card;
use OCA\Deck\Db\Stack;
use OCP\Search\SearchResultEntry;
class BoardSearchResultEntry extends SearchResultEntry {
class CardSearchResultEntry extends SearchResultEntry {
public function __construct(Board $board, $urlGenerator) {
parent::__construct('', $board->getTitle(), '', $urlGenerator->linkToRoute('deck.page.index') . '#/board/' . $board->getId(), 'icon-deck');
public function __construct(Board $board, Stack $stack, Card $card, $urlGenerator) {
parent::__construct('', $card->getTitle(), $board->getTitle() . ' » ' . $stack->getTitle() , $urlGenerator->linkToRoute('deck.page.index') . '#/board/' . $board->getId() . '/card/' . $card->getId(), 'icon-deck');
}
}