aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2017-05-05 14:33:36 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2017-05-05 14:33:36 +0200
commitd09fe4d233477d5cb9bfc613799b05a7ca14e270 (patch)
treedd1a73c030c6f618a996b895316444a703d53c31 /src/Wallabag
parentc613df0e25e9628a465758388c440da069623fd4 (diff)
downloadwallabag-d09fe4d233477d5cb9bfc613799b05a7ca14e270.tar.gz
wallabag-d09fe4d233477d5cb9bfc613799b05a7ca14e270.tar.zst
wallabag-d09fe4d233477d5cb9bfc613799b05a7ca14e270.zip
Added test for deduplication
Diffstat (limited to 'src/Wallabag')
-rw-r--r--src/Wallabag/CoreBundle/Repository/EntryRepository.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
index 5e7b0d3a..2e03fa19 100644
--- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
@@ -392,4 +392,23 @@ class EntryRepository extends EntityRepository
392 392
393 return $qb->getQuery()->getArrayResult(); 393 return $qb->getQuery()->getArrayResult();
394 } 394 }
395
396 /**
397 * Find all entries by url and owner.
398 *
399 * @param $url
400 * @param $userId
401 *
402 * @return array
403 */
404 public function findAllByUrlAndUserId($url, $userId)
405 {
406 $res = $this->createQueryBuilder('e')
407 ->where('e.url = :url')->setParameter('url', urldecode($url))
408 ->andWhere('e.user = :user_id')->setParameter('user_id', $userId)
409 ->getQuery()
410 ->getResult();
411
412 return $res;
413 }
395} 414}