X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=src%2FWallabag%2FCoreBundle%2FRepository%2FEntryRepository.php;h=b5e35eff3848a69a8e0ee43e769a7fa55aee18b1;hb=3b46d0f947958e05c55bb10a817e94a860cda6ef;hp=44f95dcba2ebd96ee6fe168c11d0d5c9660efe94;hpb=7c04b7396a296e31bb11beadc19550396ee728a8;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 44f95dcb..b5e35eff 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -151,12 +151,12 @@ class EntryRepository extends EntityRepository $qb->andWhere('e.updatedAt > :since')->setParameter('since', new \DateTime(date('Y-m-d H:i:s', $since))); } - if ('' !== $tags) { + if (is_string($tags) && '' !== $tags) { foreach (explode(',', $tags) as $i => $tag) { $entryAlias = 'e' . $i; $tagAlias = 't' . $i; - // Complexe queries to ensure multiple tags is associated to an entry + // Complexe queries to ensure multiple tags are associated to an entry // https://stackoverflow.com/a/6638146/569101 $qb->andWhere($qb->expr()->in( 'e.id', @@ -344,26 +344,6 @@ class EntryRepository extends EntityRepository return (int) $qb->getQuery()->getSingleScalarResult(); } - /** - * Count all entries for a tag and a user. - * - * @param int $userId - * @param int $tagId - * - * @return int - */ - public function countAllEntriesByUserIdAndTagId($userId, $tagId) - { - $qb = $this->createQueryBuilder('e') - ->select('count(e.id)') - ->leftJoin('e.tags', 't') - ->where('e.user = :userId')->setParameter('userId', $userId) - ->andWhere('t.id = :tagId')->setParameter('tagId', $tagId) - ; - - return (int) $qb->getQuery()->getSingleScalarResult(); - } - /** * Remove all entries for a user id. * Used when a user want to reset all informations.