{"action":"created","comment":{"url":"https://api.github.com/repos/lasf/federacija-turbo/pulls/comments/43242370","id":43242370,"diff_hunk":"@@ -0,0 +1,113 @@\n+<?php namespace AppBundle\\Controller;\n+\n+use AppBundle\\Entity\\DeclarantRequest;\n+use AppBundle\\Entity\\User;\n+use AppBundle\\Form\\DeclarantRequestType;\n+use DataDog\\PagerBundle\\Pagination;\n+use Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller;\n+use Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Route;\n+use Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Method;\n+use Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Template;\n+use Symfony\\Component\\HttpFoundation\\Request;\n+\n+/**\n+ * @Route(\"/declarant\")\n+ */\n+class DeclarantController extends Controller\n+{\n+    use DoctrineController;\n+\n+    /**\n+     * @Route(\"/\")\n+     * @Method(\"GET\")\n+     * @Template\n+     * @param Request $request\n+     * @return array\n+     */\n+    public function indexAction(Request $request)\n+    {\n+        $declarantRequests = $this->get('em')->getRepository(DeclarantRequest::class)->createQueryBuilder('dr');\n+        return [\n+            'requests' => new Pagination($declarantRequests, $request),\n+        ];\n+    }\n+\n+    /**\n+     * @Route(\"/change\")\n+     * @Method({\"GET\", \"POST\"})\n+     * @Template\n+     * @param Request $request\n+     * @return array\n+     */\n+    public function changeAction(Request $request)\n+    {\n+        /** @var User $user */\n+        $user = $this->getUser();\n+        $declarantRequest = new DeclarantRequest();\n+        $form = $this->createForm(new DeclarantRequestType($user), $declarantRequest);\n+        $form->handleRequest($request);\n+        if ($form->isValid()) {\n+            $this->persist($declarantRequest);\n+            $this->flush();\n+            $this->addFlash(\"success\", $this->get('translator')->trans('declarant.flash.request_sent'));\n+        }\n+        return [\n+            'form' => $form->createView()\n+        ];\n+    }\n+\n+    /**\n+     * @Route(\"/{id}/show\")\n+     * @Method(\"GET\")\n+     * @Template\n+     * @param DeclarantRequest $id\n+     * @return array\n+     */\n+    public function showAction(DeclarantRequest $id)\n+    {\n+        $declarantRequest = $this->get('em')->getRepository(DeclarantRequest::class)->find($id);","path":"src/AppBundle/Controller/DeclarantController.php","position":68,"original_position":68,"commit_id":"c31af2c3bc58c4eea5ec0e990c451e363e531ccb","original_commit_id":"c31af2c3bc58c4eea5ec0e990c451e363e531ccb","user":{"login":"ValdasK","id":4756408,"avatar_url":"https://avatars.githubusercontent.com/u/4756408?v=3","gravatar_id":"","url":"https://api.github.com/users/ValdasK","html_url":"https://github.com/ValdasK","followers_url":"https://api.github.com/users/ValdasK/followers","following_url":"https://api.github.com/users/ValdasK/following{/other_user}","gists_url":"https://api.github.com/users/ValdasK/gists{/gist_id}","starred_url":"https://api.github.com/users/ValdasK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ValdasK/subscriptions","organizations_url":"https://api.github.com/users/ValdasK/orgs","repos_url":"https://api.github.com/users/ValdasK/repos","events_url":"https://api.github.com/users/ValdasK/events{/privacy}","received_events_url":"https://api.github.com/users/ValdasK/received_events","type":"User","site_admin":false},"body":"Cia vel tas pats bereikalingas ieskojimas","created_at":"2015-10-28T11:14:31Z","updated_at":"2015-10-28T11:14:31Z","html_url":"https://github.com/lasf/federacija-turbo/pull/8#discussion_r43242370","pull_request_url":"https://api.github.com/repos/lasf/federacija-turbo/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/lasf/federacija-turbo/pulls/comments/43242370"},"html":{"href":"https://github.com/lasf/federacija-turbo/pull/8#discussion_r43242370"},"pull_request":{"href":"https://api.github.com/repos/lasf/federacija-turbo/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/lasf/federacija-turbo/pulls/8","id":48978707,"html_url":"https://github.com/lasf/federacija-turbo/pull/8","diff_url":"https://github.com/lasf/federacija-turbo/pull/8.diff","patch_url":"https://github.com/lasf/federacija-turbo/pull/8.patch","issue_url":"https://api.github.com/repos/lasf/federacija-turbo/issues/8","number":8,"state":"open","locked":false,"title":"Feature/change declarant","user":{"login":"aisteza","id":6652589,"avatar_url":"https://avatars.githubusercontent.com/u/6652589?v=3","gravatar_id":"","url":"https://api.github.com/users/aisteza","html_url":"https://github.com/aisteza","followers_url":"https://api.github.com/users/aisteza/followers","following_url":"https://api.github.com/users/aisteza/following{/other_user}","gists_url":"https://api.github.com/users/aisteza/gists{/gist_id}","starred_url":"https://api.github.com/users/aisteza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aisteza/subscriptions","organizations_url":"https://api.github.com/users/aisteza/orgs","repos_url":"https://api.github.com/users/aisteza/repos","events_url":"https://api.github.com/users/aisteza/events{/privacy}","received_events_url":"https://api.github.com/users/aisteza/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-28T08:58:41Z","updated_at":"2015-10-28T11:14:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"abb5fba4f2295a1e7d0a7bf92ef44d289faf0598","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lasf/federacija-turbo/pulls/8/commits","review_comments_url":"https://api.github.com/repos/lasf/federacija-turbo/pulls/8/comments","review_comment_url":"https://api.github.com/repos/lasf/federacija-turbo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lasf/federacija-turbo/issues/8/comments","statuses_url":"https://api.github.com/repos/lasf/federacija-turbo/statuses/c31af2c3bc58c4eea5ec0e990c451e363e531ccb","head":{"label":"lasf:feature/change-declarant","ref":"feature/change-declarant","sha":"c31af2c3bc58c4eea5ec0e990c451e363e531ccb","user":{"login":"lasf","id":15195820,"avatar_url":"https://avatars.githubusercontent.com/u/15195820?v=3","gravatar_id":"","url":"https://api.github.com/users/lasf","html_url":"https://github.com/lasf","followers_url":"https://api.github.com/users/lasf/followers","following_url":"https://api.github.com/users/lasf/following{/other_user}","gists_url":"https://api.github.com/users/lasf/gists{/gist_id}","starred_url":"https://api.github.com/users/lasf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lasf/subscriptions","organizations_url":"https://api.github.com/users/lasf/orgs","repos_url":"https://api.github.com/users/lasf/repos","events_url":"https://api.github.com/users/lasf/events{/privacy}","received_events_url":"https://api.github.com/users/lasf/received_events","type":"Organization","site_admin":false},"repo":{"id":44657834,"name":"federacija-turbo","full_name":"lasf/federacija-turbo","owner":{"login":"lasf","id":15195820,"avatar_url":"https://avatars.githubusercontent.com/u/15195820?v=3","gravatar_id":"","url":"https://api.github.com/users/lasf","html_url":"https://github.com/lasf","followers_url":"https://api.github.com/users/lasf/followers","following_url":"https://api.github.com/users/lasf/following{/other_user}","gists_url":"https://api.github.com/users/lasf/gists{/gist_id}","starred_url":"https://api.github.com/users/lasf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lasf/subscriptions","organizations_url":"https://api.github.com/users/lasf/orgs","repos_url":"https://api.github.com/users/lasf/repos","events_url":"https://api.github.com/users/lasf/events{/privacy}","received_events_url":"https://api.github.com/users/lasf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lasf/federacija-turbo","description":"","fork":false,"url":"https://api.github.com/repos/lasf/federacija-turbo","forks_url":"https://api.github.com/repos/lasf/federacija-turbo/forks","keys_url":"https://api.github.com/repos/lasf/federacija-turbo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lasf/federacija-turbo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lasf/federacija-turbo/teams","hooks_url":"https://api.github.com/repos/lasf/federacija-turbo/hooks","issue_events_url":"https://api.github.com/repos/lasf/federacija-turbo/issues/events{/number}","events_url":"https://api.github.com/repos/lasf/federacija-turbo/events","assignees_url":"https://api.github.com/repos/lasf/federacija-turbo/assignees{/user}","branches_url":"https://api.github.com/repos/lasf/federacija-turbo/branches{/branch}","tags_url":"https://api.github.com/repos/lasf/federacija-turbo/tags","blobs_url":"https://api.github.com/repos/lasf/federacija-turbo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lasf/federacija-turbo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lasf/federacija-turbo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lasf/federacija-turbo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lasf/federacija-turbo/statuses/{sha}","languages_url":"https://api.github.com/repos/lasf/federacija-turbo/languages","stargazers_url":"https://api.github.com/repos/lasf/federacija-turbo/stargazers","contributors_url":"https://api.github.com/repos/lasf/federacija-turbo/contributors","subscribers_url":"https://api.github.com/repos/lasf/federacija-turbo/subscribers","subscription_url":"https://api.github.com/repos/lasf/federacija-turbo/subscription","commits_url":"https://api.github.com/repos/lasf/federacija-turbo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lasf/federacija-turbo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lasf/federacija-turbo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lasf/federacija-turbo/issues/comments{/number}","contents_url":"https://api.github.com/repos/lasf/federacija-turbo/contents/{+path}","compare_url":"https://api.github.com/repos/lasf/federacija-turbo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lasf/federacija-turbo/merges","archive_url":"https://api.github.com/repos/lasf/federacija-turbo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lasf/federacija-turbo/downloads","issues_url":"https://api.github.com/repos/lasf/federacija-turbo/issues{/number}","pulls_url":"https://api.github.com/repos/lasf/federacija-turbo/pulls{/number}","milestones_url":"https://api.github.com/repos/lasf/federacija-turbo/milestones{/number}","notifications_url":"https://api.github.com/repos/lasf/federacija-turbo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lasf/federacija-turbo/labels{/name}","releases_url":"https://api.github.com/repos/lasf/federacija-turbo/releases{/id}","created_at":"2015-10-21T06:48:03Z","updated_at":"2015-10-21T06:51:32Z","pushed_at":"2015-10-28T11:11:30Z","git_url":"git://github.com/lasf/federacija-turbo.git","ssh_url":"git@github.com:lasf/federacija-turbo.git","clone_url":"https://github.com/lasf/federacija-turbo.git","svn_url":"https://github.com/lasf/federacija-turbo","homepage":null,"size":524,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"lasf:master","ref":"master","sha":"f21d48c75bc5cd348853d59b732edc9e5549a076","user":{"login":"lasf","id":15195820,"avatar_url":"https://avatars.githubusercontent.com/u/15195820?v=3","gravatar_id":"","url":"https://api.github.com/users/lasf","html_url":"https://github.com/lasf","followers_url":"https://api.github.com/users/lasf/followers","following_url":"https://api.github.com/users/lasf/following{/other_user}","gists_url":"https://api.github.com/users/lasf/gists{/gist_id}","starred_url":"https://api.github.com/users/lasf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lasf/subscriptions","organizations_url":"https://api.github.com/users/lasf/orgs","repos_url":"https://api.github.com/users/lasf/repos","events_url":"https://api.github.com/users/lasf/events{/privacy}","received_events_url":"https://api.github.com/users/lasf/received_events","type":"Organization","site_admin":false},"repo":{"id":44657834,"name":"federacija-turbo","full_name":"lasf/federacija-turbo","owner":{"login":"lasf","id":15195820,"avatar_url":"https://avatars.githubusercontent.com/u/15195820?v=3","gravatar_id":"","url":"https://api.github.com/users/lasf","html_url":"https://github.com/lasf","followers_url":"https://api.github.com/users/lasf/followers","following_url":"https://api.github.com/users/lasf/following{/other_user}","gists_url":"https://api.github.com/users/lasf/gists{/gist_id}","starred_url":"https://api.github.com/users/lasf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lasf/subscriptions","organizations_url":"https://api.github.com/users/lasf/orgs","repos_url":"https://api.github.com/users/lasf/repos","events_url":"https://api.github.com/users/lasf/events{/privacy}","received_events_url":"https://api.github.com/users/lasf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lasf/federacija-turbo","description":"","fork":false,"url":"https://api.github.com/repos/lasf/federacija-turbo","forks_url":"https://api.github.com/repos/lasf/federacija-turbo/forks","keys_url":"https://api.github.com/repos/lasf/federacija-turbo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lasf/federacija-turbo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lasf/federacija-turbo/teams","hooks_url":"https://api.github.com/repos/lasf/federacija-turbo/hooks","issue_events_url":"https://api.github.com/repos/lasf/federacija-turbo/issues/events{/number}","events_url":"https://api.github.com/repos/lasf/federacija-turbo/events","assignees_url":"https://api.github.com/repos/lasf/federacija-turbo/assignees{/user}","branches_url":"https://api.github.com/repos/lasf/federacija-turbo/branches{/branch}","tags_url":"https://api.github.com/repos/lasf/federacija-turbo/tags","blobs_url":"https://api.github.com/repos/lasf/federacija-turbo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lasf/federacija-turbo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lasf/federacija-turbo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lasf/federacija-turbo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lasf/federacija-turbo/statuses/{sha}","languages_url":"https://api.github.com/repos/lasf/federacija-turbo/languages","stargazers_url":"https://api.github.com/repos/lasf/federacija-turbo/stargazers","contributors_url":"https://api.github.com/repos/lasf/federacija-turbo/contributors","subscribers_url":"https://api.github.com/repos/lasf/federacija-turbo/subscribers","subscription_url":"https://api.github.com/repos/lasf/federacija-turbo/subscription","commits_url":"https://api.github.com/repos/lasf/federacija-turbo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lasf/federacija-turbo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lasf/federacija-turbo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lasf/federacija-turbo/issues/comments{/number}","contents_url":"https://api.github.com/repos/lasf/federacija-turbo/contents/{+path}","compare_url":"https://api.github.com/repos/lasf/federacija-turbo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lasf/federacija-turbo/merges","archive_url":"https://api.github.com/repos/lasf/federacija-turbo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lasf/federacija-turbo/downloads","issues_url":"https://api.github.com/repos/lasf/federacija-turbo/issues{/number}","pulls_url":"https://api.github.com/repos/lasf/federacija-turbo/pulls{/number}","milestones_url":"https://api.github.com/repos/lasf/federacija-turbo/milestones{/number}","notifications_url":"https://api.github.com/repos/lasf/federacija-turbo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lasf/federacija-turbo/labels{/name}","releases_url":"https://api.github.com/repos/lasf/federacija-turbo/releases{/id}","created_at":"2015-10-21T06:48:03Z","updated_at":"2015-10-21T06:51:32Z","pushed_at":"2015-10-28T11:11:30Z","git_url":"git://github.com/lasf/federacija-turbo.git","ssh_url":"git@github.com:lasf/federacija-turbo.git","clone_url":"https://github.com/lasf/federacija-turbo.git","svn_url":"https://github.com/lasf/federacija-turbo","homepage":null,"size":524,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lasf/federacija-turbo/pulls/8"},"html":{"href":"https://github.com/lasf/federacija-turbo/pull/8"},"issue":{"href":"https://api.github.com/repos/lasf/federacija-turbo/issues/8"},"comments":{"href":"https://api.github.com/repos/lasf/federacija-turbo/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/lasf/federacija-turbo/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/lasf/federacija-turbo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lasf/federacija-turbo/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/lasf/federacija-turbo/statuses/c31af2c3bc58c4eea5ec0e990c451e363e531ccb"}}}}