diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-06-29 09:34:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-29 09:34:39 +0200 |
commit | a314b920bf20feedbeee6ce0432be89901091481 (patch) | |
tree | 7780e54b4ffc809c5f9248e29edfe8084dacc9b0 /src/Wallabag/ApiBundle | |
parent | 33e2aec18b25d2c47774fede22ecd91e936b4400 (diff) | |
parent | e43c78abd9193641d07ea27d0275fc19419b89ad (diff) | |
download | wallabag-a314b920bf20feedbeee6ce0432be89901091481.tar.gz wallabag-a314b920bf20feedbeee6ce0432be89901091481.tar.zst wallabag-a314b920bf20feedbeee6ce0432be89901091481.zip |
Merge pull request #2176 from wallabag/add-since-parameter
Add since parameter
Diffstat (limited to 'src/Wallabag/ApiBundle')
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/WallabagRestController.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index af24e498..4fae4b0a 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php | |||
@@ -34,6 +34,7 @@ class WallabagRestController extends FOSRestController | |||
34 | * {"name"="page", "dataType"="integer", "required"=false, "format"="default '1'", "description"="what page you want."}, | 34 | * {"name"="page", "dataType"="integer", "required"=false, "format"="default '1'", "description"="what page you want."}, |
35 | * {"name"="perPage", "dataType"="integer", "required"=false, "format"="default'30'", "description"="results per page."}, | 35 | * {"name"="perPage", "dataType"="integer", "required"=false, "format"="default'30'", "description"="results per page."}, |
36 | * {"name"="tags", "dataType"="string", "required"=false, "format"="api,rest", "description"="a list of tags url encoded. Will returns entries that matches ALL tags."}, | 36 | * {"name"="tags", "dataType"="string", "required"=false, "format"="api,rest", "description"="a list of tags url encoded. Will returns entries that matches ALL tags."}, |
37 | * {"name"="since", "dataType"="integer", "required"=false, "format"="default '0'", "description"="The timestamp since when you want entries updated."}, | ||
37 | * } | 38 | * } |
38 | * ) | 39 | * ) |
39 | * | 40 | * |
@@ -49,10 +50,11 @@ class WallabagRestController extends FOSRestController | |||
49 | $order = $request->query->get('order', 'desc'); | 50 | $order = $request->query->get('order', 'desc'); |
50 | $page = (int) $request->query->get('page', 1); | 51 | $page = (int) $request->query->get('page', 1); |
51 | $perPage = (int) $request->query->get('perPage', 30); | 52 | $perPage = (int) $request->query->get('perPage', 30); |
53 | $since = $request->query->get('since', 0); | ||
52 | 54 | ||
53 | $pager = $this->getDoctrine() | 55 | $pager = $this->getDoctrine() |
54 | ->getRepository('WallabagCoreBundle:Entry') | 56 | ->getRepository('WallabagCoreBundle:Entry') |
55 | ->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $sort, $order); | 57 | ->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $sort, $order, $since); |
56 | 58 | ||
57 | $pager->setCurrentPage($page); | 59 | $pager->setCurrentPage($page); |
58 | $pager->setMaxPerPage($perPage); | 60 | $pager->setMaxPerPage($perPage); |