{"action":"created","comment":{"url":"https://api.github.com/repos/Opifer/ContentBundle/pulls/comments/25241534","id":25241534,"diff_hunk":"@@ -69,18 +90,74 @@ public function viewAction(Request $request, $id)\n     }\n \n     /**\n-     * Delete\n+     * Restore\n      *\n      * @param Request $request\n      * @param integer $id\n      *\n-     * @return Response\n+     * @return JsonResponse\n+     */\n+    public function restoreAction(Request $request, $id)\n+    {\n+        $manager = $this->get('opifer.content.content_manager');\n+        $repository = $manager->getRepository();\n+        $repository->setRetrieveArchived(true);\n+        $content = $repository->find($id);\n+\n+\n+        if(is_null($content)) {\n+            return new JsonResponse(['success' => false ]);\n+        }\n+\n+        $content->setDeletedAt(null);\n+        $em = $this->get('doctrine')->getManager();\n+        $em->persist($content);\n+        $em->flush();\n+        $repository->setRetrieveArchived(false);\n+\n+        return new JsonResponse(['success' => true ]);\n+    }\n+\n+    /**\n+     * Delete\n+     *\n+     * @param Request $request\n+     * @param $id\n+     * @return null|JsonResponse|Response\n      */\n     public function deleteAction(Request $request, $id)\n     {\n+        return $this->deleteContent($request, $id);\n+    }\n+\n+    /**\n+     * Permanent Delete\n+     *\n+     * @param Request $request\n+     * @param $id\n+     * @return null|JsonResponse|Response\n+     */\n+    public function permaAction(Request $request, $id)\n+    {\n+        return $this->deleteContent($request, $id, true);\n+    }\n+\n+    /**\n+     *\n+     * @param Request $request\n+     * @param $id\n+     * @param bool $archive\n+     * @return null|JsonResponse|Response\n+     */\n+    private function deleteContent(Request $request, $id, $archive = false) {","path":"Controller/Api/ContentController.php","position":103,"original_position":103,"commit_id":"14dd0c35c1b2fb43cc9ec6fa85facef273ef4e11","original_commit_id":"14dd0c35c1b2fb43cc9ec6fa85facef273ef4e11","user":{"login":"rvanlaarhoven","id":1857585,"avatar_url":"https://avatars.githubusercontent.com/u/1857585?v=3","gravatar_id":"","url":"https://api.github.com/users/rvanlaarhoven","html_url":"https://github.com/rvanlaarhoven","followers_url":"https://api.github.com/users/rvanlaarhoven/followers","following_url":"https://api.github.com/users/rvanlaarhoven/following{/other_user}","gists_url":"https://api.github.com/users/rvanlaarhoven/gists{/gist_id}","starred_url":"https://api.github.com/users/rvanlaarhoven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvanlaarhoven/subscriptions","organizations_url":"https://api.github.com/users/rvanlaarhoven/orgs","repos_url":"https://api.github.com/users/rvanlaarhoven/repos","events_url":"https://api.github.com/users/rvanlaarhoven/events{/privacy}","received_events_url":"https://api.github.com/users/rvanlaarhoven/received_events","type":"User","site_admin":false},"body":"Can you place the opening-curly-bracket on a new line?","created_at":"2015-02-24T10:17:59Z","updated_at":"2015-02-24T10:17:59Z","html_url":"https://github.com/Opifer/ContentBundle/pull/11#discussion_r25241534","pull_request_url":"https://api.github.com/repos/Opifer/ContentBundle/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/Opifer/ContentBundle/pulls/comments/25241534"},"html":{"href":"https://github.com/Opifer/ContentBundle/pull/11#discussion_r25241534"},"pull_request":{"href":"https://api.github.com/repos/Opifer/ContentBundle/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/Opifer/ContentBundle/pulls/11","id":29884597,"html_url":"https://github.com/Opifer/ContentBundle/pull/11","diff_url":"https://github.com/Opifer/ContentBundle/pull/11.diff","patch_url":"https://github.com/Opifer/ContentBundle/pull/11.patch","issue_url":"https://api.github.com/repos/Opifer/ContentBundle/issues/11","number":11,"state":"open","locked":false,"title":"Archive","user":{"login":"michaelsieben","id":2239833,"avatar_url":"https://avatars.githubusercontent.com/u/2239833?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelsieben","html_url":"https://github.com/michaelsieben","followers_url":"https://api.github.com/users/michaelsieben/followers","following_url":"https://api.github.com/users/michaelsieben/following{/other_user}","gists_url":"https://api.github.com/users/michaelsieben/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelsieben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelsieben/subscriptions","organizations_url":"https://api.github.com/users/michaelsieben/orgs","repos_url":"https://api.github.com/users/michaelsieben/repos","events_url":"https://api.github.com/users/michaelsieben/events{/privacy}","received_events_url":"https://api.github.com/users/michaelsieben/received_events","type":"User","site_admin":false},"body":"Added functionality to archive content.\r\nNew page in which you can restore or permanently delete content. ","created_at":"2015-02-24T10:12:13Z","updated_at":"2015-02-24T10:17:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"79870dc2f7dca951343db1370642e9c37151a34e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Opifer/ContentBundle/pulls/11/commits","review_comments_url":"https://api.github.com/repos/Opifer/ContentBundle/pulls/11/comments","review_comment_url":"https://api.github.com/repos/Opifer/ContentBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Opifer/ContentBundle/issues/11/comments","statuses_url":"https://api.github.com/repos/Opifer/ContentBundle/statuses/14dd0c35c1b2fb43cc9ec6fa85facef273ef4e11","head":{"label":"Opifer:archive","ref":"archive","sha":"14dd0c35c1b2fb43cc9ec6fa85facef273ef4e11","user":{"login":"Opifer","id":4159790,"avatar_url":"https://avatars.githubusercontent.com/u/4159790?v=3","gravatar_id":"","url":"https://api.github.com/users/Opifer","html_url":"https://github.com/Opifer","followers_url":"https://api.github.com/users/Opifer/followers","following_url":"https://api.github.com/users/Opifer/following{/other_user}","gists_url":"https://api.github.com/users/Opifer/gists{/gist_id}","starred_url":"https://api.github.com/users/Opifer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Opifer/subscriptions","organizations_url":"https://api.github.com/users/Opifer/orgs","repos_url":"https://api.github.com/users/Opifer/repos","events_url":"https://api.github.com/users/Opifer/events{/privacy}","received_events_url":"https://api.github.com/users/Opifer/received_events","type":"Organization","site_admin":false},"repo":{"id":25863636,"name":"ContentBundle","full_name":"Opifer/ContentBundle","owner":{"login":"Opifer","id":4159790,"avatar_url":"https://avatars.githubusercontent.com/u/4159790?v=3","gravatar_id":"","url":"https://api.github.com/users/Opifer","html_url":"https://github.com/Opifer","followers_url":"https://api.github.com/users/Opifer/followers","following_url":"https://api.github.com/users/Opifer/following{/other_user}","gists_url":"https://api.github.com/users/Opifer/gists{/gist_id}","starred_url":"https://api.github.com/users/Opifer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Opifer/subscriptions","organizations_url":"https://api.github.com/users/Opifer/orgs","repos_url":"https://api.github.com/users/Opifer/repos","events_url":"https://api.github.com/users/Opifer/events{/privacy}","received_events_url":"https://api.github.com/users/Opifer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Opifer/ContentBundle","description":"Adds the possibility to create pages with dynamic content in Symfony2 projects","fork":false,"url":"https://api.github.com/repos/Opifer/ContentBundle","forks_url":"https://api.github.com/repos/Opifer/ContentBundle/forks","keys_url":"https://api.github.com/repos/Opifer/ContentBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Opifer/ContentBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Opifer/ContentBundle/teams","hooks_url":"https://api.github.com/repos/Opifer/ContentBundle/hooks","issue_events_url":"https://api.github.com/repos/Opifer/ContentBundle/issues/events{/number}","events_url":"https://api.github.com/repos/Opifer/ContentBundle/events","assignees_url":"https://api.github.com/repos/Opifer/ContentBundle/assignees{/user}","branches_url":"https://api.github.com/repos/Opifer/ContentBundle/branches{/branch}","tags_url":"https://api.github.com/repos/Opifer/ContentBundle/tags","blobs_url":"https://api.github.com/repos/Opifer/ContentBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Opifer/ContentBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Opifer/ContentBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/Opifer/ContentBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Opifer/ContentBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/Opifer/ContentBundle/languages","stargazers_url":"https://api.github.com/repos/Opifer/ContentBundle/stargazers","contributors_url":"https://api.github.com/repos/Opifer/ContentBundle/contributors","subscribers_url":"https://api.github.com/repos/Opifer/ContentBundle/subscribers","subscription_url":"https://api.github.com/repos/Opifer/ContentBundle/subscription","commits_url":"https://api.github.com/repos/Opifer/ContentBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/Opifer/ContentBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/Opifer/ContentBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/Opifer/ContentBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/Opifer/ContentBundle/contents/{+path}","compare_url":"https://api.github.com/repos/Opifer/ContentBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Opifer/ContentBundle/merges","archive_url":"https://api.github.com/repos/Opifer/ContentBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Opifer/ContentBundle/downloads","issues_url":"https://api.github.com/repos/Opifer/ContentBundle/issues{/number}","pulls_url":"https://api.github.com/repos/Opifer/ContentBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/Opifer/ContentBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/Opifer/ContentBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Opifer/ContentBundle/labels{/name}","releases_url":"https://api.github.com/repos/Opifer/ContentBundle/releases{/id}","created_at":"2014-10-28T10:15:32Z","updated_at":"2015-02-20T12:03:12Z","pushed_at":"2015-02-24T10:10:09Z","git_url":"git://github.com/Opifer/ContentBundle.git","ssh_url":"git@github.com:Opifer/ContentBundle.git","clone_url":"https://github.com/Opifer/ContentBundle.git","svn_url":"https://github.com/Opifer/ContentBundle","homepage":"","size":580,"stargazers_count":2,"watchers_count":2,"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":2,"default_branch":"master"}},"base":{"label":"Opifer:master","ref":"master","sha":"ce1cea4546de88986420c98e47168a5f66eca100","user":{"login":"Opifer","id":4159790,"avatar_url":"https://avatars.githubusercontent.com/u/4159790?v=3","gravatar_id":"","url":"https://api.github.com/users/Opifer","html_url":"https://github.com/Opifer","followers_url":"https://api.github.com/users/Opifer/followers","following_url":"https://api.github.com/users/Opifer/following{/other_user}","gists_url":"https://api.github.com/users/Opifer/gists{/gist_id}","starred_url":"https://api.github.com/users/Opifer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Opifer/subscriptions","organizations_url":"https://api.github.com/users/Opifer/orgs","repos_url":"https://api.github.com/users/Opifer/repos","events_url":"https://api.github.com/users/Opifer/events{/privacy}","received_events_url":"https://api.github.com/users/Opifer/received_events","type":"Organization","site_admin":false},"repo":{"id":25863636,"name":"ContentBundle","full_name":"Opifer/ContentBundle","owner":{"login":"Opifer","id":4159790,"avatar_url":"https://avatars.githubusercontent.com/u/4159790?v=3","gravatar_id":"","url":"https://api.github.com/users/Opifer","html_url":"https://github.com/Opifer","followers_url":"https://api.github.com/users/Opifer/followers","following_url":"https://api.github.com/users/Opifer/following{/other_user}","gists_url":"https://api.github.com/users/Opifer/gists{/gist_id}","starred_url":"https://api.github.com/users/Opifer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Opifer/subscriptions","organizations_url":"https://api.github.com/users/Opifer/orgs","repos_url":"https://api.github.com/users/Opifer/repos","events_url":"https://api.github.com/users/Opifer/events{/privacy}","received_events_url":"https://api.github.com/users/Opifer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Opifer/ContentBundle","description":"Adds the possibility to create pages with dynamic content in Symfony2 projects","fork":false,"url":"https://api.github.com/repos/Opifer/ContentBundle","forks_url":"https://api.github.com/repos/Opifer/ContentBundle/forks","keys_url":"https://api.github.com/repos/Opifer/ContentBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Opifer/ContentBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Opifer/ContentBundle/teams","hooks_url":"https://api.github.com/repos/Opifer/ContentBundle/hooks","issue_events_url":"https://api.github.com/repos/Opifer/ContentBundle/issues/events{/number}","events_url":"https://api.github.com/repos/Opifer/ContentBundle/events","assignees_url":"https://api.github.com/repos/Opifer/ContentBundle/assignees{/user}","branches_url":"https://api.github.com/repos/Opifer/ContentBundle/branches{/branch}","tags_url":"https://api.github.com/repos/Opifer/ContentBundle/tags","blobs_url":"https://api.github.com/repos/Opifer/ContentBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Opifer/ContentBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Opifer/ContentBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/Opifer/ContentBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Opifer/ContentBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/Opifer/ContentBundle/languages","stargazers_url":"https://api.github.com/repos/Opifer/ContentBundle/stargazers","contributors_url":"https://api.github.com/repos/Opifer/ContentBundle/contributors","subscribers_url":"https://api.github.com/repos/Opifer/ContentBundle/subscribers","subscription_url":"https://api.github.com/repos/Opifer/ContentBundle/subscription","commits_url":"https://api.github.com/repos/Opifer/ContentBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/Opifer/ContentBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/Opifer/ContentBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/Opifer/ContentBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/Opifer/ContentBundle/contents/{+path}","compare_url":"https://api.github.com/repos/Opifer/ContentBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Opifer/ContentBundle/merges","archive_url":"https://api.github.com/repos/Opifer/ContentBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Opifer/ContentBundle/downloads","issues_url":"https://api.github.com/repos/Opifer/ContentBundle/issues{/number}","pulls_url":"https://api.github.com/repos/Opifer/ContentBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/Opifer/ContentBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/Opifer/ContentBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Opifer/ContentBundle/labels{/name}","releases_url":"https://api.github.com/repos/Opifer/ContentBundle/releases{/id}","created_at":"2014-10-28T10:15:32Z","updated_at":"2015-02-20T12:03:12Z","pushed_at":"2015-02-24T10:10:09Z","git_url":"git://github.com/Opifer/ContentBundle.git","ssh_url":"git@github.com:Opifer/ContentBundle.git","clone_url":"https://github.com/Opifer/ContentBundle.git","svn_url":"https://github.com/Opifer/ContentBundle","homepage":"","size":580,"stargazers_count":2,"watchers_count":2,"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":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Opifer/ContentBundle/pulls/11"},"html":{"href":"https://github.com/Opifer/ContentBundle/pull/11"},"issue":{"href":"https://api.github.com/repos/Opifer/ContentBundle/issues/11"},"comments":{"href":"https://api.github.com/repos/Opifer/ContentBundle/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/Opifer/ContentBundle/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/Opifer/ContentBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Opifer/ContentBundle/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/Opifer/ContentBundle/statuses/14dd0c35c1b2fb43cc9ec6fa85facef273ef4e11"}}}}