mirror of
https://github.com/chenasraf/nextcloud-forum.git
synced 2026-05-18 01:28:58 +00:00
feat: bookmark threads
This commit is contained in:
@@ -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>
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user