diff --git a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php index f77a37498..27d11da5e 100644 --- a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php @@ -68,7 +68,7 @@ class WallabagRestController extends Controller ->getRepository('WallabagCoreBundle:Entry') ->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $isDeleted, $sort, $order); - if (!is_array($entries)) { + if (!($entries)) { throw $this->createNotFoundException(); } diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 1805cf3f4..b6f867070 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -98,7 +98,7 @@ class EntryRepository extends EntityRepository * @param string $sort * @param string $order * - * @return ArrayCollection + * @return array */ public function findEntries($userId, $isArchived = null, $isStarred = null, $isDeleted = null, $sort = 'created', $order = 'ASC') { @@ -126,6 +126,6 @@ class EntryRepository extends EntityRepository return $qb ->getQuery() - ->getResult(Query::HYDRATE_ARRAY); + ->getResult(); } }