X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FRepository%2FEntriesRepository.php;h=d87eb373069ebf9ea37ad386cdf2ed891518d8bd;hb=7df80cb32ca9b7d0fe452320ddc3563a1e373e2f;hp=5a71b9efe80d6606590ff38996d2419dccbcbd83;hpb=ad4d1caa9e744af57ca58a4e57576533eb682d00;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Repository/EntriesRepository.php b/src/Wallabag/CoreBundle/Repository/EntriesRepository.php index 5a71b9ef..d87eb373 100644 --- a/src/Wallabag/CoreBundle/Repository/EntriesRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntriesRepository.php @@ -5,6 +5,7 @@ namespace Wallabag\CoreBundle\Repository; use Doctrine\ORM\Query; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\Tools\Pagination\Paginator; +use Wallabag\CoreBundle\Entity\Entries; class EntriesRepository extends EntityRepository { @@ -13,7 +14,7 @@ class EntriesRepository extends EntityRepository * * @param $userId * @param $firstResult - * @param int $maxResults + * @param int $maxResults * @return Paginator */ public function findUnreadByUser($userId, $firstResult, $maxResults = 12) @@ -36,7 +37,7 @@ class EntriesRepository extends EntityRepository * * @param $userId * @param $firstResult - * @param int $maxResults + * @param int $maxResults * @return Paginator */ public function findArchiveByUser($userId, $firstResult, $maxResults = 12) @@ -59,7 +60,7 @@ class EntriesRepository extends EntityRepository * * @param $userId * @param $firstResult - * @param int $maxResults + * @param int $maxResults * @return Paginator */ public function findStarredByUser($userId, $firstResult, $maxResults = 12) @@ -76,4 +77,18 @@ class EntriesRepository extends EntityRepository return $paginator; } + + public function findEntries($userId, $isArchived, $isStarred, $isDeleted, $sort, $order) + { + //TODO tous les paramètres ne sont pas utilisés, à corriger + $qb = $this->createQueryBuilder('e') + ->select('e') + ->where('e.isFav =:isStarred')->setParameter('isStarred', $isStarred) + ->andWhere('e.isRead =:isArchived')->setParameter('isArchived', $isArchived) + ->andWhere('e.userId =:userId')->setParameter('userId', $userId) + ->getQuery() + ->getResult(Query::HYDRATE_ARRAY); + + return $qb; + } }