Merge remote-tracking branch 'origin/master' into 2.5.0

This commit is contained in:
Jeremy Benoist
2022-03-02 20:03:33 +01:00
178 changed files with 7400 additions and 5225 deletions

View File

@ -115,7 +115,7 @@ class EntryRepository extends EntityRepository
if ('starred' === $currentRoute) {
$qb->andWhere('e.isStarred = true');
} elseif ('unread' === $currentRoute) {
} elseif ('unread' === $currentRoute || 'homepage' === $currentRoute) {
$qb->andWhere('e.isArchived = false');
} elseif ('archive' === $currentRoute) {
$qb->andWhere('e.isArchived = true');
@ -448,6 +448,22 @@ class EntryRepository extends EntityRepository
return false;
}
public function findByUserIdAndBatchHashedUrls($userId, $hashedUrls)
{
$qb = $this->createQueryBuilder('e')->select(['e.id', 'e.hashedUrl', 'e.hashedGivenUrl']);
$res = $qb->where('e.user = :user_id')->setParameter('user_id', $userId)
->andWhere(
$qb->expr()->orX(
$qb->expr()->in('e.hashedUrl', $hashedUrls),
$qb->expr()->in('e.hashedGivenUrl', $hashedUrls)
)
)
->getQuery()
->getResult();
return $res;
}
/**
* Count all entries for a user.
*

View File

@ -70,6 +70,7 @@ class TagRepository extends EntityRepository
return $this->getQueryBuilderByUser($userId)
->select('t.id, t.label, t.slug, count(e.id) as nbEntries')
->distinct(true)
->orderBy('t.label')
->getQuery()
->getArrayResult();
}