@@ -145,6 +145,20 @@ class Repository
|
||||
)->fetchAll();
|
||||
}
|
||||
|
||||
public function searchAlerts(string $query, int $limit = 100): array
|
||||
{
|
||||
$stmt = $this->db->pdo()->prepare(
|
||||
"SELECT a.* FROM alerts a
|
||||
JOIN alerts_fts fts ON a.id = fts.rowid
|
||||
WHERE alerts_fts MATCH ?
|
||||
ORDER BY rank
|
||||
LIMIT ?"
|
||||
);
|
||||
$stmt->execute([$query, $limit]);
|
||||
$rows = $stmt->fetchAll();
|
||||
return array_map(fn(array $r) => Alert::fromRow($r), $rows);
|
||||
}
|
||||
|
||||
// --- Config ---
|
||||
|
||||
public function getAllowedUserTokens(): array
|
||||
|
||||
Reference in New Issue
Block a user