diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-01-23 16:28:37 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-01-23 16:28:37 +0100 |
commit | ad4d1caa9e744af57ca58a4e57576533eb682d00 (patch) | |
tree | 37d6c284d2afc7fc62cdf80be419b536ab4ea603 /src/WallabagBundle/Repository | |
parent | b84a80559a1167b5500fbc5eb4965d3b08b371ef (diff) | |
download | wallabag-ad4d1caa9e744af57ca58a4e57576533eb682d00.tar.gz wallabag-ad4d1caa9e744af57ca58a4e57576533eb682d00.tar.zst wallabag-ad4d1caa9e744af57ca58a4e57576533eb682d00.zip |
move WallabagBundle into Wallabag:CoreBundle
Diffstat (limited to 'src/WallabagBundle/Repository')
-rw-r--r-- | src/WallabagBundle/Repository/EntriesRepository.php | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/src/WallabagBundle/Repository/EntriesRepository.php b/src/WallabagBundle/Repository/EntriesRepository.php deleted file mode 100644 index 3eb1733d..00000000 --- a/src/WallabagBundle/Repository/EntriesRepository.php +++ /dev/null | |||
@@ -1,79 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace WallabagBundle\Repository; | ||
4 | |||
5 | use Doctrine\ORM\Query; | ||
6 | use Doctrine\ORM\EntityRepository; | ||
7 | use Doctrine\ORM\Tools\Pagination\Paginator; | ||
8 | |||
9 | class EntriesRepository extends EntityRepository | ||
10 | { | ||
11 | /** | ||
12 | * Retrieves unread entries for a user | ||
13 | * | ||
14 | * @param $userId | ||
15 | * @param $firstResult | ||
16 | * @param int $maxResults | ||
17 | * @return Paginator | ||
18 | */ | ||
19 | public function findUnreadByUser($userId, $firstResult, $maxResults = 12) | ||
20 | { | ||
21 | $qb = $this->createQueryBuilder('e') | ||
22 | ->select('e') | ||
23 | ->setFirstResult($firstResult) | ||
24 | ->setMaxResults($maxResults) | ||
25 | ->where('e.isRead = 0') | ||
26 | ->andWhere('e.userId =:userId')->setParameter('userId', $userId) | ||
27 | ->getQuery(); | ||
28 | |||
29 | $paginator = new Paginator($qb); | ||
30 | |||
31 | return $paginator; | ||
32 | } | ||
33 | |||
34 | /** | ||
35 | * Retrieves read entries for a user | ||
36 | * | ||
37 | * @param $userId | ||
38 | * @param $firstResult | ||
39 | * @param int $maxResults | ||
40 | * @return Paginator | ||
41 | */ | ||
42 | public function findArchiveByUser($userId, $firstResult, $maxResults = 12) | ||
43 | { | ||
44 | $qb = $this->createQueryBuilder('e') | ||
45 | ->select('e') | ||
46 | ->setFirstResult($firstResult) | ||
47 | ->setMaxResults($maxResults) | ||
48 | ->where('e.isRead = 1') | ||
49 | ->andWhere('e.userId =:userId')->setParameter('userId', $userId) | ||
50 | ->getQuery(); | ||
51 | |||
52 | $paginator = new Paginator($qb); | ||
53 | |||
54 | return $paginator; | ||
55 | } | ||
56 | |||
57 | /** | ||
58 | * Retrieves starred entries for a user | ||
59 | * | ||
60 | * @param $userId | ||
61 | * @param $firstResult | ||
62 | * @param int $maxResults | ||
63 | * @return Paginator | ||
64 | */ | ||
65 | public function findStarredByUser($userId, $firstResult, $maxResults = 12) | ||
66 | { | ||
67 | $qb = $this->createQueryBuilder('e') | ||
68 | ->select('e') | ||
69 | ->setFirstResult($firstResult) | ||
70 | ->setMaxResults($maxResults) | ||
71 | ->where('e.isFav = 1') | ||
72 | ->andWhere('e.userId =:userId')->setParameter('userId', $userId) | ||
73 | ->getQuery(); | ||
74 | |||
75 | $paginator = new Paginator($qb); | ||
76 | |||
77 | return $paginator; | ||
78 | } | ||
79 | } | ||