feat: bookmark threads

This commit is contained in:
2025-12-09 00:31:12 +02:00
parent 164c188617
commit 973580ef2b
13 changed files with 2066 additions and 3 deletions

View File

@@ -176,6 +176,30 @@ class ThreadMapper extends QBMapper {
return (int)($row['count'] ?? 0);
}
/**
* Find threads by multiple IDs
*
* @param array<int> $ids Array of thread IDs
* @return array<Thread>
*/
public function findByIds(array $ids): array {
if (empty($ids)) {
return [];
}
/* @var $qb IQueryBuilder */
$qb = $this->db->getQueryBuilder();
$qb->select('*')
->from($this->getTableName())
->where(
$qb->expr()->in('id', $qb->createNamedParameter($ids, IQueryBuilder::PARAM_INT_ARRAY))
)
->andWhere(
$qb->expr()->isNull('deleted_at')
);
return $this->findEntities($qb);
}
/**
* @return array<Thread>
*/