X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabagBundle%2FRepository%2FEntriesRepository.php;h=c355a012c61dd51a68ccc0a1e914f4d9468e3a42;hb=bd9f08157cc10619e9bb9dace6df43090dde44a9;hp=4c13c9c2fd65f07fa6b104207a3f990714e556a8;hpb=9d50517ceaeadaba227ccdbaa43a5918abd16728;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/WallabagBundle/Repository/EntriesRepository.php b/src/WallabagBundle/Repository/EntriesRepository.php index 4c13c9c2..c355a012 100644 --- a/src/WallabagBundle/Repository/EntriesRepository.php +++ b/src/WallabagBundle/Repository/EntriesRepository.php @@ -13,14 +13,6 @@ use Doctrine\ORM\EntityRepository; */ class EntriesRepository extends EntityRepository { - /* public function findUnreadByUser($userId) - { - return $this->createQueryBuilder('e') - ->where('e.is_read = 0') - ->andWhere('e.user_id = :userId') - ->setParameter('userId', $userId) - ->getQuery(); - }*/ public function findUnreadByUser($userId) { $qb = $this->createQueryBuilder('e') @@ -32,4 +24,28 @@ class EntriesRepository extends EntityRepository return $qb; } + + public function findArchiveByUser($userId) + { + $qb = $this->createQueryBuilder('e') + ->select('e') + ->where('e.isRead = 1') + ->andWhere('e.userId =:userId')->setParameter('userId', $userId) + ->getQuery() + ->getResult(Query::HYDRATE_ARRAY); + + return $qb; + } + + public function findStarredByUser($userId) + { + $qb = $this->createQueryBuilder('e') + ->select('e') + ->where('e.isFav = 1') + ->andWhere('e.userId =:userId')->setParameter('userId', $userId) + ->getQuery() + ->getResult(Query::HYDRATE_ARRAY); + + return $qb; + } }