{"action":"created","comment":{"url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/pulls/comments/24287684","id":24287684,"diff_hunk":"@@ -0,0 +1,125 @@\n+<?php\n+namespace Shop\\AdminBundle\\Controller;\n+\n+use Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Method;\n+use Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Route;\n+use Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Template;\n+use Shop\\AdminBundle\\Form\\ProductType;\n+use Shop\\CommonBundle\\Controller\\CommonController;\n+use Shop\\WebSiteBundle\\Entity\\Product;\n+use Shop\\WebSiteBundle\\Service\\ProductService;\n+use Symfony\\Component\\HttpFoundation\\Request;\n+use Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException;\n+\n+/**\n+ * Class ProductController\n+ * @package Shop\\AdminBundle\\Controller\n+ * @Route(\"/product\", service=\"shop.admin.product_controller\")\n+ */\n+class ProductController extends CommonController\n+{\n+    const MESSAGE_PRODUCT_NOT_FOUND = 'Unable to find Product entity #%s';\n+\n+    /**\n+     * @var ProductService\n+     */\n+    protected $productService;\n+\n+    /**\n+     * Displays a form to create a new Product entity.\n+     *\n+     * @Route(\"/new\", name=\"admin_product_new\")\n+     * @Template()\n+     */\n+    public function newAction(Request $request)\n+    {\n+        $entity = $this->productService->createProduct();\n+        $form = $this->createForm(new ProductType(), $entity);\n+        $form->handleRequest($request);\n+        if ($form->isValid()) {\n+            $this->productService->save($entity);\n+            return $this->redirect($this->generateUrl('admin_product_show', ['id' => $entity->getId()]));\n+        }\n+        return [\n+            'entity' => $entity,\n+            'form' => $form->createView(),\n+        ];\n+    }\n+\n+    /**\n+     * Finds and displays a Product entity.\n+     *\n+     * @Route(\"/{id}\", name=\"admin_product_show\", requirements={\n+     *     \"id\": \"\\d+\"\n+     * })\n+     * @Method(\"GET\")\n+     * @Template()\n+     */\n+    public function showAction($id)\n+    {\n+        $entity = $this->getProductById($id);\n+        return ['entity' => $entity];\n+    }\n+\n+    /**\n+     * Displays a form to edit an existing Product entity.\n+     *\n+     * @Route(\"/{id}/edit\", name=\"admin_product_edit\", requirements={\n+     *     \"id\": \"\\d+\"\n+     * })\n+     * @Template()\n+     */\n+    public function editAction(Request $request, $id)\n+    {\n+        $entity = $this->getProductById($id);\n+        $editForm = $this->createForm(new ProductType(), $entity);\n+        $editForm->handleRequest($request);\n+        if ($editForm->isValid()) {\n+            $this->productService->save($entity);","path":"src/Shop/AdminBundle/Controller/ProductController.php","position":78,"original_position":78,"commit_id":"c9b2076b84b76bdd8124e457852de459add61dfe","original_commit_id":"c9b2076b84b76bdd8124e457852de459add61dfe","user":{"login":"EduardTrayan","id":5230673,"avatar_url":"https://avatars.githubusercontent.com/u/5230673?v=3","gravatar_id":"","url":"https://api.github.com/users/EduardTrayan","html_url":"https://github.com/EduardTrayan","followers_url":"https://api.github.com/users/EduardTrayan/followers","following_url":"https://api.github.com/users/EduardTrayan/following{/other_user}","gists_url":"https://api.github.com/users/EduardTrayan/gists{/gist_id}","starred_url":"https://api.github.com/users/EduardTrayan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EduardTrayan/subscriptions","organizations_url":"https://api.github.com/users/EduardTrayan/orgs","repos_url":"https://api.github.com/users/EduardTrayan/repos","events_url":"https://api.github.com/users/EduardTrayan/events{/privacy}","received_events_url":"https://api.github.com/users/EduardTrayan/received_events","type":"User","site_admin":false},"body":"Please perform redirect here for avoid double submit issues","created_at":"2015-02-07T07:14:34Z","updated_at":"2015-02-07T07:14:34Z","html_url":"https://github.com/EduardTrayan/sf2c-vanchuk/pull/7#discussion_r24287684","pull_request_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/pulls/comments/24287684"},"html":{"href":"https://github.com/EduardTrayan/sf2c-vanchuk/pull/7#discussion_r24287684"},"pull_request":{"href":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/pulls/7","id":27973784,"html_url":"https://github.com/EduardTrayan/sf2c-vanchuk/pull/7","diff_url":"https://github.com/EduardTrayan/sf2c-vanchuk/pull/7.diff","patch_url":"https://github.com/EduardTrayan/sf2c-vanchuk/pull/7.patch","issue_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/issues/7","number":7,"state":"open","locked":false,"title":"T006 crud for products","user":{"login":"vvs-code","id":6904368,"avatar_url":"https://avatars.githubusercontent.com/u/6904368?v=3","gravatar_id":"","url":"https://api.github.com/users/vvs-code","html_url":"https://github.com/vvs-code","followers_url":"https://api.github.com/users/vvs-code/followers","following_url":"https://api.github.com/users/vvs-code/following{/other_user}","gists_url":"https://api.github.com/users/vvs-code/gists{/gist_id}","starred_url":"https://api.github.com/users/vvs-code/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvs-code/subscriptions","organizations_url":"https://api.github.com/users/vvs-code/orgs","repos_url":"https://api.github.com/users/vvs-code/repos","events_url":"https://api.github.com/users/vvs-code/events{/privacy}","received_events_url":"https://api.github.com/users/vvs-code/received_events","type":"User","site_admin":false},"body":"Add/ Edit/ Remove products","created_at":"2015-01-24T08:41:09Z","updated_at":"2015-02-07T07:14:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3ef0a026ebf1bd392ed44d701c1ec645cf019f7b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/pulls/7/commits","review_comments_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/pulls/7/comments","review_comment_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/pulls/comments/{number}","comments_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/issues/7/comments","statuses_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/statuses/c9b2076b84b76bdd8124e457852de459add61dfe","head":{"label":"vvs-code:t006_CRUD_for_products","ref":"t006_CRUD_for_products","sha":"c9b2076b84b76bdd8124e457852de459add61dfe","user":{"login":"vvs-code","id":6904368,"avatar_url":"https://avatars.githubusercontent.com/u/6904368?v=3","gravatar_id":"","url":"https://api.github.com/users/vvs-code","html_url":"https://github.com/vvs-code","followers_url":"https://api.github.com/users/vvs-code/followers","following_url":"https://api.github.com/users/vvs-code/following{/other_user}","gists_url":"https://api.github.com/users/vvs-code/gists{/gist_id}","starred_url":"https://api.github.com/users/vvs-code/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvs-code/subscriptions","organizations_url":"https://api.github.com/users/vvs-code/orgs","repos_url":"https://api.github.com/users/vvs-code/repos","events_url":"https://api.github.com/users/vvs-code/events{/privacy}","received_events_url":"https://api.github.com/users/vvs-code/received_events","type":"User","site_admin":false},"repo":{"id":27025250,"name":"Bigsoft-SF2-intro","full_name":"vvs-code/Bigsoft-SF2-intro","owner":{"login":"vvs-code","id":6904368,"avatar_url":"https://avatars.githubusercontent.com/u/6904368?v=3","gravatar_id":"","url":"https://api.github.com/users/vvs-code","html_url":"https://github.com/vvs-code","followers_url":"https://api.github.com/users/vvs-code/followers","following_url":"https://api.github.com/users/vvs-code/following{/other_user}","gists_url":"https://api.github.com/users/vvs-code/gists{/gist_id}","starred_url":"https://api.github.com/users/vvs-code/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvs-code/subscriptions","organizations_url":"https://api.github.com/users/vvs-code/orgs","repos_url":"https://api.github.com/users/vvs-code/repos","events_url":"https://api.github.com/users/vvs-code/events{/privacy}","received_events_url":"https://api.github.com/users/vvs-code/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vvs-code/Bigsoft-SF2-intro","description":"","fork":true,"url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro","forks_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/forks","keys_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/teams","hooks_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/hooks","issue_events_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/issues/events{/number}","events_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/events","assignees_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/assignees{/user}","branches_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/branches{/branch}","tags_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/tags","blobs_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/git/refs{/sha}","trees_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/statuses/{sha}","languages_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/languages","stargazers_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/stargazers","contributors_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/contributors","subscribers_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/subscribers","subscription_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/subscription","commits_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/commits{/sha}","git_commits_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/git/commits{/sha}","comments_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/comments{/number}","issue_comment_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/issues/comments/{number}","contents_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/contents/{+path}","compare_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/merges","archive_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/downloads","issues_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/issues{/number}","pulls_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/pulls{/number}","milestones_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/milestones{/number}","notifications_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/labels{/name}","releases_url":"https://api.github.com/repos/vvs-code/Bigsoft-SF2-intro/releases{/id}","created_at":"2014-11-23T07:26:49Z","updated_at":"2014-12-04T07:08:20Z","pushed_at":"2015-02-06T15:38:23Z","git_url":"git://github.com/vvs-code/Bigsoft-SF2-intro.git","ssh_url":"git@github.com:vvs-code/Bigsoft-SF2-intro.git","clone_url":"https://github.com/vvs-code/Bigsoft-SF2-intro.git","svn_url":"https://github.com/vvs-code/Bigsoft-SF2-intro","homepage":null,"size":1186,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"EduardTrayan:master","ref":"master","sha":"737cf518147f90e8978a95c0d0094e3259c648a9","user":{"login":"EduardTrayan","id":5230673,"avatar_url":"https://avatars.githubusercontent.com/u/5230673?v=3","gravatar_id":"","url":"https://api.github.com/users/EduardTrayan","html_url":"https://github.com/EduardTrayan","followers_url":"https://api.github.com/users/EduardTrayan/followers","following_url":"https://api.github.com/users/EduardTrayan/following{/other_user}","gists_url":"https://api.github.com/users/EduardTrayan/gists{/gist_id}","starred_url":"https://api.github.com/users/EduardTrayan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EduardTrayan/subscriptions","organizations_url":"https://api.github.com/users/EduardTrayan/orgs","repos_url":"https://api.github.com/users/EduardTrayan/repos","events_url":"https://api.github.com/users/EduardTrayan/events{/privacy}","received_events_url":"https://api.github.com/users/EduardTrayan/received_events","type":"User","site_admin":false},"repo":{"id":26950815,"name":"sf2c-vanchuk","full_name":"EduardTrayan/sf2c-vanchuk","owner":{"login":"EduardTrayan","id":5230673,"avatar_url":"https://avatars.githubusercontent.com/u/5230673?v=3","gravatar_id":"","url":"https://api.github.com/users/EduardTrayan","html_url":"https://github.com/EduardTrayan","followers_url":"https://api.github.com/users/EduardTrayan/followers","following_url":"https://api.github.com/users/EduardTrayan/following{/other_user}","gists_url":"https://api.github.com/users/EduardTrayan/gists{/gist_id}","starred_url":"https://api.github.com/users/EduardTrayan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EduardTrayan/subscriptions","organizations_url":"https://api.github.com/users/EduardTrayan/orgs","repos_url":"https://api.github.com/users/EduardTrayan/repos","events_url":"https://api.github.com/users/EduardTrayan/events{/privacy}","received_events_url":"https://api.github.com/users/EduardTrayan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/EduardTrayan/sf2c-vanchuk","description":"","fork":false,"url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk","forks_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/forks","keys_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/teams","hooks_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/hooks","issue_events_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/issues/events{/number}","events_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/events","assignees_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/assignees{/user}","branches_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/branches{/branch}","tags_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/tags","blobs_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/git/refs{/sha}","trees_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/statuses/{sha}","languages_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/languages","stargazers_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/stargazers","contributors_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/contributors","subscribers_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/subscribers","subscription_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/subscription","commits_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/commits{/sha}","git_commits_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/git/commits{/sha}","comments_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/comments{/number}","issue_comment_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/issues/comments/{number}","contents_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/contents/{+path}","compare_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/merges","archive_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/downloads","issues_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/issues{/number}","pulls_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/pulls{/number}","milestones_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/milestones{/number}","notifications_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/labels{/name}","releases_url":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/releases{/id}","created_at":"2014-11-21T07:52:45Z","updated_at":"2015-01-19T12:13:42Z","pushed_at":"2015-01-19T12:13:42Z","git_url":"git://github.com/EduardTrayan/sf2c-vanchuk.git","ssh_url":"git@github.com:EduardTrayan/sf2c-vanchuk.git","clone_url":"https://github.com/EduardTrayan/sf2c-vanchuk.git","svn_url":"https://github.com/EduardTrayan/sf2c-vanchuk","homepage":null,"size":956,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/pulls/7"},"html":{"href":"https://github.com/EduardTrayan/sf2c-vanchuk/pull/7"},"issue":{"href":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/issues/7"},"comments":{"href":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/EduardTrayan/sf2c-vanchuk/statuses/c9b2076b84b76bdd8124e457852de459add61dfe"}}}}