X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FRepository%2FEntryRepository.php;h=7f35bb9a19b6746ea665d34fab6de9acc4d853ec;hb=f11a3cf21ca77f16b5dff3a6d015f2043317c596;hp=a65bfe3b12d05435de01b860158324419589ae9f;hpb=f808b01692a835673f328d7221ba8c212caa9b61;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index a65bfe3b..7f35bb9a 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -3,9 +3,10 @@ namespace Wallabag\CoreBundle\Repository; use Doctrine\ORM\EntityRepository; -use Doctrine\ORM\Query; +use Doctrine\ORM\QueryBuilder; use Pagerfanta\Adapter\DoctrineORMAdapter; use Pagerfanta\Pagerfanta; +use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; class EntryRepository extends EntityRepository @@ -74,7 +75,7 @@ class EntryRepository extends EntityRepository * * @param int $userId * @param string $term - * @param strint $currentRoute + * @param string $currentRoute * * @return QueryBuilder */ @@ -126,7 +127,7 @@ class EntryRepository extends EntityRepository * @param int $since * @param string $tags * - * @return array + * @return Pagerfanta */ public function findEntries($userId, $isArchived = null, $isStarred = null, $isPublic = null, $sort = 'created', $order = 'ASC', $since = 0, $tags = '') { @@ -172,7 +173,7 @@ class EntryRepository extends EntityRepository * * @param int $userId * - * @return Entry + * @return array */ public function findOneWithTags($userId) { @@ -325,7 +326,7 @@ class EntryRepository extends EntityRepository ->where('e.user=:userId')->setParameter('userId', $userId) ; - return $qb->getQuery()->getSingleScalarResult(); + return (int) $qb->getQuery()->getSingleScalarResult(); } /** @@ -345,7 +346,7 @@ class EntryRepository extends EntityRepository ->andWhere('t.id=:tagId')->setParameter('tagId', $tagId) ; - return $qb->getQuery()->getSingleScalarResult(); + return (int) $qb->getQuery()->getSingleScalarResult(); } /**