{"action":"created","comment":{"url":"https://api.github.com/repos/geekhub-php/CheDream2/pulls/comments/26900259","id":26900259,"diff_hunk":"@@ -0,0 +1,118 @@\n+<?php\n+\n+namespace Geekhub\\DreamBundle\\Controller\\Api;\n+\n+use Geekhub\\DreamBundle\\Model\\DreamsResponse;\n+use Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException;\n+use Nelmio\\ApiDocBundle\\Annotation\\ApiDoc;\n+use FOS\\RestBundle\\Controller\\Annotations\\View as RestView;\n+use FOS\\RestBundle\\View\\View;\n+use FOS\\RestBundle\\Controller\\Annotations\\QueryParam;\n+use FOS\\RestBundle\\Request\\ParamFetcher;\n+use FOS\\RestBundle\\Controller\\FOSRestController;\n+\n+class DreamController extends FOSRestController\n+{\n+    /**\n+     * Get dreams for parameter,<br />\n+     *      * <strong>Simple example:</strong><br />\n+     * http://chedream2/app_dev.php/api/dreams.json?count=2&page=2&sort_by=id&sort_order=ASC\n+     *\n+     * @ApiDoc(\n+     * resource = true,\n+     * description = \"Gets all Dream\",\n+     * output = \"Geekhub\\DreamBundle\\Entity\\Dream\",\n+     * statusCodes = {\n+     *      200 = \"Returned when successful\",\n+     *      404 = \"Returned when the Dream is not found\"\n+     * },\n+     * section=\"All dreams \"\n+     * )\n+     *\n+     *\n+     * RestView()\n+     *\n+     * @QueryParam(name=\"count\", requirements=\"\\d+\", default=\"10\", description=\"Count dreams at one page\")\n+     * @QueryParam(name=\"page\", requirements=\"\\d+\", default=\"1\", description=\"Number of page to be shown\")\n+     * @QueryParam(name=\"sort_by\", strict=true, requirements=\"^[a-zA-Z]+\", default=\"createdAt\", description=\"Sort by\", nullable=true)\n+     * @QueryParam(name=\"sort_order\", strict=true, requirements=\"^[a-zA-Z]+\", default=\"DESC\", description=\"Sort order\", nullable=true)\n+     *\n+     * @param  ParamFetcher $paramFetcher\n+     * @return View\n+     *\n+     * @throws NotFoundHttpException when not exist\n+     */\n+    public function getDreamsAction(ParamFetcher $paramFetcher)\n+    {\n+        $manager = $this->getDoctrine()->getManager();\n+        $dreams = $manager->getRepository('GeekhubDreamBundle:Dream')->findBy([],[$paramFetcher->get('sort_by') => $paramFetcher->get('sort_order')], $paramFetcher->get('count'), $paramFetcher->get('page'));\n+        $dreamsAll = $manager->getRepository('GeekhubDreamBundle:Dream')->findAll();\n+        $selfPage = $this->generateUrl('get_dreams', array(","path":"src/Geekhub/DreamBundle/Controller/Api/DreamController.php","position":50,"original_position":50,"commit_id":"a5ca33c9a06956aeda20942c7247a8ad768de67f","original_commit_id":"a5ca33c9a06956aeda20942c7247a8ad768de67f","user":{"login":"spolischook","id":1978331,"avatar_url":"https://avatars.githubusercontent.com/u/1978331?v=3","gravatar_id":"","url":"https://api.github.com/users/spolischook","html_url":"https://github.com/spolischook","followers_url":"https://api.github.com/users/spolischook/followers","following_url":"https://api.github.com/users/spolischook/following{/other_user}","gists_url":"https://api.github.com/users/spolischook/gists{/gist_id}","starred_url":"https://api.github.com/users/spolischook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spolischook/subscriptions","organizations_url":"https://api.github.com/users/spolischook/orgs","repos_url":"https://api.github.com/users/spolischook/repos","events_url":"https://api.github.com/users/spolischook/events{/privacy}","received_events_url":"https://api.github.com/users/spolischook/received_events","type":"User","site_admin":false},"body":"Move pagination logic in separate service named Paginator","created_at":"2015-03-22T06:20:21Z","updated_at":"2015-03-22T06:20:21Z","html_url":"https://github.com/geekhub-php/CheDream2/pull/149#discussion_r26900259","pull_request_url":"https://api.github.com/repos/geekhub-php/CheDream2/pulls/149","_links":{"self":{"href":"https://api.github.com/repos/geekhub-php/CheDream2/pulls/comments/26900259"},"html":{"href":"https://github.com/geekhub-php/CheDream2/pull/149#discussion_r26900259"},"pull_request":{"href":"https://api.github.com/repos/geekhub-php/CheDream2/pulls/149"}}},"pull_request":{"url":"https://api.github.com/repos/geekhub-php/CheDream2/pulls/149","id":31631033,"html_url":"https://github.com/geekhub-php/CheDream2/pull/149","diff_url":"https://github.com/geekhub-php/CheDream2/pull/149.diff","patch_url":"https://github.com/geekhub-php/CheDream2/pull/149.patch","issue_url":"https://api.github.com/repos/geekhub-php/CheDream2/issues/149","number":149,"state":"open","locked":false,"title":"Rest dream","user":{"login":"shubaivan","id":1485872,"avatar_url":"https://avatars.githubusercontent.com/u/1485872?v=3","gravatar_id":"","url":"https://api.github.com/users/shubaivan","html_url":"https://github.com/shubaivan","followers_url":"https://api.github.com/users/shubaivan/followers","following_url":"https://api.github.com/users/shubaivan/following{/other_user}","gists_url":"https://api.github.com/users/shubaivan/gists{/gist_id}","starred_url":"https://api.github.com/users/shubaivan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shubaivan/subscriptions","organizations_url":"https://api.github.com/users/shubaivan/orgs","repos_url":"https://api.github.com/users/shubaivan/repos","events_url":"https://api.github.com/users/shubaivan/events{/privacy}","received_events_url":"https://api.github.com/users/shubaivan/received_events","type":"User","site_admin":false},"body":"Create DreamController -  getDreamsAction and getDreamAction","created_at":"2015-03-20T16:48:19Z","updated_at":"2015-03-22T06:20:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0be71ace86156537e6e2c0100bf50b896d86bded","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/geekhub-php/CheDream2/pulls/149/commits","review_comments_url":"https://api.github.com/repos/geekhub-php/CheDream2/pulls/149/comments","review_comment_url":"https://api.github.com/repos/geekhub-php/CheDream2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geekhub-php/CheDream2/issues/149/comments","statuses_url":"https://api.github.com/repos/geekhub-php/CheDream2/statuses/a5ca33c9a06956aeda20942c7247a8ad768de67f","head":{"label":"geekhub-php:rest_dream","ref":"rest_dream","sha":"a5ca33c9a06956aeda20942c7247a8ad768de67f","user":{"login":"geekhub-php","id":2575237,"avatar_url":"https://avatars.githubusercontent.com/u/2575237?v=3","gravatar_id":"","url":"https://api.github.com/users/geekhub-php","html_url":"https://github.com/geekhub-php","followers_url":"https://api.github.com/users/geekhub-php/followers","following_url":"https://api.github.com/users/geekhub-php/following{/other_user}","gists_url":"https://api.github.com/users/geekhub-php/gists{/gist_id}","starred_url":"https://api.github.com/users/geekhub-php/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geekhub-php/subscriptions","organizations_url":"https://api.github.com/users/geekhub-php/orgs","repos_url":"https://api.github.com/users/geekhub-php/repos","events_url":"https://api.github.com/users/geekhub-php/events{/privacy}","received_events_url":"https://api.github.com/users/geekhub-php/received_events","type":"Organization","site_admin":false},"repo":{"id":16346009,"name":"CheDream2","full_name":"geekhub-php/CheDream2","owner":{"login":"geekhub-php","id":2575237,"avatar_url":"https://avatars.githubusercontent.com/u/2575237?v=3","gravatar_id":"","url":"https://api.github.com/users/geekhub-php","html_url":"https://github.com/geekhub-php","followers_url":"https://api.github.com/users/geekhub-php/followers","following_url":"https://api.github.com/users/geekhub-php/following{/other_user}","gists_url":"https://api.github.com/users/geekhub-php/gists{/gist_id}","starred_url":"https://api.github.com/users/geekhub-php/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geekhub-php/subscriptions","organizations_url":"https://api.github.com/users/geekhub-php/orgs","repos_url":"https://api.github.com/users/geekhub-php/repos","events_url":"https://api.github.com/users/geekhub-php/events{/privacy}","received_events_url":"https://api.github.com/users/geekhub-php/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geekhub-php/CheDream2","description":"!DEPRECATED! Now we use https://github.com/geekhub-php/CheDream3","fork":false,"url":"https://api.github.com/repos/geekhub-php/CheDream2","forks_url":"https://api.github.com/repos/geekhub-php/CheDream2/forks","keys_url":"https://api.github.com/repos/geekhub-php/CheDream2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geekhub-php/CheDream2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geekhub-php/CheDream2/teams","hooks_url":"https://api.github.com/repos/geekhub-php/CheDream2/hooks","issue_events_url":"https://api.github.com/repos/geekhub-php/CheDream2/issues/events{/number}","events_url":"https://api.github.com/repos/geekhub-php/CheDream2/events","assignees_url":"https://api.github.com/repos/geekhub-php/CheDream2/assignees{/user}","branches_url":"https://api.github.com/repos/geekhub-php/CheDream2/branches{/branch}","tags_url":"https://api.github.com/repos/geekhub-php/CheDream2/tags","blobs_url":"https://api.github.com/repos/geekhub-php/CheDream2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geekhub-php/CheDream2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geekhub-php/CheDream2/git/refs{/sha}","trees_url":"https://api.github.com/repos/geekhub-php/CheDream2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geekhub-php/CheDream2/statuses/{sha}","languages_url":"https://api.github.com/repos/geekhub-php/CheDream2/languages","stargazers_url":"https://api.github.com/repos/geekhub-php/CheDream2/stargazers","contributors_url":"https://api.github.com/repos/geekhub-php/CheDream2/contributors","subscribers_url":"https://api.github.com/repos/geekhub-php/CheDream2/subscribers","subscription_url":"https://api.github.com/repos/geekhub-php/CheDream2/subscription","commits_url":"https://api.github.com/repos/geekhub-php/CheDream2/commits{/sha}","git_commits_url":"https://api.github.com/repos/geekhub-php/CheDream2/git/commits{/sha}","comments_url":"https://api.github.com/repos/geekhub-php/CheDream2/comments{/number}","issue_comment_url":"https://api.github.com/repos/geekhub-php/CheDream2/issues/comments{/number}","contents_url":"https://api.github.com/repos/geekhub-php/CheDream2/contents/{+path}","compare_url":"https://api.github.com/repos/geekhub-php/CheDream2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geekhub-php/CheDream2/merges","archive_url":"https://api.github.com/repos/geekhub-php/CheDream2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geekhub-php/CheDream2/downloads","issues_url":"https://api.github.com/repos/geekhub-php/CheDream2/issues{/number}","pulls_url":"https://api.github.com/repos/geekhub-php/CheDream2/pulls{/number}","milestones_url":"https://api.github.com/repos/geekhub-php/CheDream2/milestones{/number}","notifications_url":"https://api.github.com/repos/geekhub-php/CheDream2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geekhub-php/CheDream2/labels{/name}","releases_url":"https://api.github.com/repos/geekhub-php/CheDream2/releases{/id}","created_at":"2014-01-29T13:51:56Z","updated_at":"2015-01-15T09:40:36Z","pushed_at":"2015-03-21T14:03:40Z","git_url":"git://github.com/geekhub-php/CheDream2.git","ssh_url":"git@github.com:geekhub-php/CheDream2.git","clone_url":"https://github.com/geekhub-php/CheDream2.git","svn_url":"https://github.com/geekhub-php/CheDream2","homepage":"http://chedream.org/","size":47440,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":2,"forks":13,"open_issues":2,"watchers":0,"default_branch":"slicing"}},"base":{"label":"geekhub-php:rest_api","ref":"rest_api","sha":"0fbb8776208aba73c61bcd5fe607218e21cc74fc","user":{"login":"geekhub-php","id":2575237,"avatar_url":"https://avatars.githubusercontent.com/u/2575237?v=3","gravatar_id":"","url":"https://api.github.com/users/geekhub-php","html_url":"https://github.com/geekhub-php","followers_url":"https://api.github.com/users/geekhub-php/followers","following_url":"https://api.github.com/users/geekhub-php/following{/other_user}","gists_url":"https://api.github.com/users/geekhub-php/gists{/gist_id}","starred_url":"https://api.github.com/users/geekhub-php/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geekhub-php/subscriptions","organizations_url":"https://api.github.com/users/geekhub-php/orgs","repos_url":"https://api.github.com/users/geekhub-php/repos","events_url":"https://api.github.com/users/geekhub-php/events{/privacy}","received_events_url":"https://api.github.com/users/geekhub-php/received_events","type":"Organization","site_admin":false},"repo":{"id":16346009,"name":"CheDream2","full_name":"geekhub-php/CheDream2","owner":{"login":"geekhub-php","id":2575237,"avatar_url":"https://avatars.githubusercontent.com/u/2575237?v=3","gravatar_id":"","url":"https://api.github.com/users/geekhub-php","html_url":"https://github.com/geekhub-php","followers_url":"https://api.github.com/users/geekhub-php/followers","following_url":"https://api.github.com/users/geekhub-php/following{/other_user}","gists_url":"https://api.github.com/users/geekhub-php/gists{/gist_id}","starred_url":"https://api.github.com/users/geekhub-php/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geekhub-php/subscriptions","organizations_url":"https://api.github.com/users/geekhub-php/orgs","repos_url":"https://api.github.com/users/geekhub-php/repos","events_url":"https://api.github.com/users/geekhub-php/events{/privacy}","received_events_url":"https://api.github.com/users/geekhub-php/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geekhub-php/CheDream2","description":"!DEPRECATED! Now we use https://github.com/geekhub-php/CheDream3","fork":false,"url":"https://api.github.com/repos/geekhub-php/CheDream2","forks_url":"https://api.github.com/repos/geekhub-php/CheDream2/forks","keys_url":"https://api.github.com/repos/geekhub-php/CheDream2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geekhub-php/CheDream2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geekhub-php/CheDream2/teams","hooks_url":"https://api.github.com/repos/geekhub-php/CheDream2/hooks","issue_events_url":"https://api.github.com/repos/geekhub-php/CheDream2/issues/events{/number}","events_url":"https://api.github.com/repos/geekhub-php/CheDream2/events","assignees_url":"https://api.github.com/repos/geekhub-php/CheDream2/assignees{/user}","branches_url":"https://api.github.com/repos/geekhub-php/CheDream2/branches{/branch}","tags_url":"https://api.github.com/repos/geekhub-php/CheDream2/tags","blobs_url":"https://api.github.com/repos/geekhub-php/CheDream2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geekhub-php/CheDream2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geekhub-php/CheDream2/git/refs{/sha}","trees_url":"https://api.github.com/repos/geekhub-php/CheDream2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geekhub-php/CheDream2/statuses/{sha}","languages_url":"https://api.github.com/repos/geekhub-php/CheDream2/languages","stargazers_url":"https://api.github.com/repos/geekhub-php/CheDream2/stargazers","contributors_url":"https://api.github.com/repos/geekhub-php/CheDream2/contributors","subscribers_url":"https://api.github.com/repos/geekhub-php/CheDream2/subscribers","subscription_url":"https://api.github.com/repos/geekhub-php/CheDream2/subscription","commits_url":"https://api.github.com/repos/geekhub-php/CheDream2/commits{/sha}","git_commits_url":"https://api.github.com/repos/geekhub-php/CheDream2/git/commits{/sha}","comments_url":"https://api.github.com/repos/geekhub-php/CheDream2/comments{/number}","issue_comment_url":"https://api.github.com/repos/geekhub-php/CheDream2/issues/comments{/number}","contents_url":"https://api.github.com/repos/geekhub-php/CheDream2/contents/{+path}","compare_url":"https://api.github.com/repos/geekhub-php/CheDream2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geekhub-php/CheDream2/merges","archive_url":"https://api.github.com/repos/geekhub-php/CheDream2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geekhub-php/CheDream2/downloads","issues_url":"https://api.github.com/repos/geekhub-php/CheDream2/issues{/number}","pulls_url":"https://api.github.com/repos/geekhub-php/CheDream2/pulls{/number}","milestones_url":"https://api.github.com/repos/geekhub-php/CheDream2/milestones{/number}","notifications_url":"https://api.github.com/repos/geekhub-php/CheDream2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geekhub-php/CheDream2/labels{/name}","releases_url":"https://api.github.com/repos/geekhub-php/CheDream2/releases{/id}","created_at":"2014-01-29T13:51:56Z","updated_at":"2015-01-15T09:40:36Z","pushed_at":"2015-03-21T14:03:40Z","git_url":"git://github.com/geekhub-php/CheDream2.git","ssh_url":"git@github.com:geekhub-php/CheDream2.git","clone_url":"https://github.com/geekhub-php/CheDream2.git","svn_url":"https://github.com/geekhub-php/CheDream2","homepage":"http://chedream.org/","size":47440,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":2,"forks":13,"open_issues":2,"watchers":0,"default_branch":"slicing"}},"_links":{"self":{"href":"https://api.github.com/repos/geekhub-php/CheDream2/pulls/149"},"html":{"href":"https://github.com/geekhub-php/CheDream2/pull/149"},"issue":{"href":"https://api.github.com/repos/geekhub-php/CheDream2/issues/149"},"comments":{"href":"https://api.github.com/repos/geekhub-php/CheDream2/issues/149/comments"},"review_comments":{"href":"https://api.github.com/repos/geekhub-php/CheDream2/pulls/149/comments"},"review_comment":{"href":"https://api.github.com/repos/geekhub-php/CheDream2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geekhub-php/CheDream2/pulls/149/commits"},"statuses":{"href":"https://api.github.com/repos/geekhub-php/CheDream2/statuses/a5ca33c9a06956aeda20942c7247a8ad768de67f"}}}}