]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #1069 from wallabag/v2-fix-return-entries
authorJeremy <j0k3r@users.noreply.github.com>
Tue, 10 Feb 2015 13:51:32 +0000 (14:51 +0100)
committerJeremy <j0k3r@users.noreply.github.com>
Tue, 10 Feb 2015 13:51:32 +0000 (14:51 +0100)
GET /api/entries returns object, no more array

1  2 
src/Wallabag/CoreBundle/Controller/WallabagRestController.php
src/Wallabag/CoreBundle/Repository/EntryRepository.php

index f77a37498a12ee3627bd7cf79e536a0612b415cd,4784cb012992d804b4b3573018d74d5791ae94ef..27d11da5ec158c931f614186d51777a75f73fa3b
@@@ -66,9 -43,9 +66,9 @@@ class WallabagRestController extends Co
          $entries = $this
              ->getDoctrine()
              ->getRepository('WallabagCoreBundle:Entry')
 -            ->findEntries(1, $isArchived, $isStarred, $isDeleted, $sort, $order);
 +            ->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $isDeleted, $sort, $order);
  
-         if (!is_array($entries)) {
+         if (!($entries)) {
              throw $this->createNotFoundException();
          }
  
index 1805cf3f4b1b3bfdf284a2517234e7f84c02ebff,abf01930d1d9c6dc14a7176b9963df99bf6962e6..b6f86707046f72b73b676768d1a1b2640bd97daa
@@@ -91,14 -91,14 +91,14 @@@ class EntryRepository extends EntityRep
      /**
       * Find Entries
       *
 -     * @param  int    $userId
 -     * @param  bool   $isArchived
 -     * @param  bool   $isStarred
 -     * @param  bool   $isDeleted
 -     * @param  string $sort
 -     * @param  string $order
 +     * @param int    $userId
 +     * @param bool   $isArchived
 +     * @param bool   $isStarred
 +     * @param bool   $isDeleted
 +     * @param string $sort
 +     * @param string $order
       *
-      * @return ArrayCollection
+      * @return array
       */
      public function findEntries($userId, $isArchived = null, $isStarred = null, $isDeleted = null, $sort = 'created', $order = 'ASC')
      {