{"action":"created","comment":{"url":"https://api.github.com/repos/backbee/BackBee/pulls/comments/23453710","id":23453710,"diff_hunk":"@@ -174,28 +171,20 @@ public function getAction($type, $uid, Request $request)\n      *\n      * @param string  $type\n      * @param Request $request\n-     *\n      * @return Symfony\\Component\\HttpFoundation\\Response\n      */\n     public function postAction($type, Request $request)\n     {\n-        $classname = $this->getClassnameByType($type);\n+        $classname = AClassContent::getClassnameByType($type);\n         $content = new $classname();\n \n-        $em = $this->getEntityManager();\n-        $em->persist($content);\n-\n-        $draft = $em->getRepository('BackBee\\ClassContent\\Revision')->getDraft(\n-            $content,\n-            $this->getApplication()->getBBUserToken(),\n-            true\n-        );\n-\n-        $content->setDraft($draft);\n-        $em->flush();\n+        $this->getEntityManager()->persist($content);\n+        $content->setDraft($this->getManager()->getRevision($content, true));","path":"Rest/Controller/ClassContentController.php","position":122,"original_position":122,"commit_id":"27f873d02cf169f6b335f4aa5159542e116103bc","original_commit_id":"27f873d02cf169f6b335f4aa5159542e116103bc","user":{"login":"eric-chau","id":1244070,"avatar_url":"https://avatars.githubusercontent.com/u/1244070?v=3","gravatar_id":"","url":"https://api.github.com/users/eric-chau","html_url":"https://github.com/eric-chau","followers_url":"https://api.github.com/users/eric-chau/followers","following_url":"https://api.github.com/users/eric-chau/following{/other_user}","gists_url":"https://api.github.com/users/eric-chau/gists{/gist_id}","starred_url":"https://api.github.com/users/eric-chau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eric-chau/subscriptions","organizations_url":"https://api.github.com/users/eric-chau/orgs","repos_url":"https://api.github.com/users/eric-chau/repos","events_url":"https://api.github.com/users/eric-chau/events{/privacy}","received_events_url":"https://api.github.com/users/eric-chau/received_events","type":"User","site_admin":false},"body":"I consider that in a ``ClassContentController`` we can easily guess that ``::getManager`` will returns a ClassContentManager. In addition I also documented the method and its type with docblock of the class attribute. I could call it something like ``getClassContentManager`` but it's kinda too long, isn't it?","created_at":"2015-01-23T14:54:43Z","updated_at":"2015-01-23T14:54:43Z","html_url":"https://github.com/backbee/BackBee/pull/211#discussion_r23453710","pull_request_url":"https://api.github.com/repos/backbee/BackBee/pulls/211","_links":{"self":{"href":"https://api.github.com/repos/backbee/BackBee/pulls/comments/23453710"},"html":{"href":"https://github.com/backbee/BackBee/pull/211#discussion_r23453710"},"pull_request":{"href":"https://api.github.com/repos/backbee/BackBee/pulls/211"}}},"pull_request":{"url":"https://api.github.com/repos/backbee/BackBee/pulls/211","id":27926099,"html_url":"https://github.com/backbee/BackBee/pull/211","diff_url":"https://github.com/backbee/BackBee/pull/211.diff","patch_url":"https://github.com/backbee/BackBee/pull/211.patch","issue_url":"https://api.github.com/repos/backbee/BackBee/issues/211","number":211,"state":"open","locked":false,"title":"[WIP] [Rest] #177 add management of classcontent update and its revisions","user":{"login":"eric-chau","id":1244070,"avatar_url":"https://avatars.githubusercontent.com/u/1244070?v=3","gravatar_id":"","url":"https://api.github.com/users/eric-chau","html_url":"https://github.com/eric-chau","followers_url":"https://api.github.com/users/eric-chau/followers","following_url":"https://api.github.com/users/eric-chau/following{/other_user}","gists_url":"https://api.github.com/users/eric-chau/gists{/gist_id}","starred_url":"https://api.github.com/users/eric-chau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eric-chau/subscriptions","organizations_url":"https://api.github.com/users/eric-chau/orgs","repos_url":"https://api.github.com/users/eric-chau/repos","events_url":"https://api.github.com/users/eric-chau/events{/privacy}","received_events_url":"https://api.github.com/users/eric-chau/received_events","type":"User","site_admin":false},"body":"More details at #177.","created_at":"2015-01-23T14:16:33Z","updated_at":"2015-01-23T14:54:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc552291fb8cabbe622784611c67097db2c17891","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/backbee/BackBee/pulls/211/commits","review_comments_url":"https://api.github.com/repos/backbee/BackBee/pulls/211/comments","review_comment_url":"https://api.github.com/repos/backbee/BackBee/pulls/comments/{number}","comments_url":"https://api.github.com/repos/backbee/BackBee/issues/211/comments","statuses_url":"https://api.github.com/repos/backbee/BackBee/statuses/27f873d02cf169f6b335f4aa5159542e116103bc","head":{"label":"backbee:177","ref":"177","sha":"27f873d02cf169f6b335f4aa5159542e116103bc","user":{"login":"backbee","id":8198689,"avatar_url":"https://avatars.githubusercontent.com/u/8198689?v=3","gravatar_id":"","url":"https://api.github.com/users/backbee","html_url":"https://github.com/backbee","followers_url":"https://api.github.com/users/backbee/followers","following_url":"https://api.github.com/users/backbee/following{/other_user}","gists_url":"https://api.github.com/users/backbee/gists{/gist_id}","starred_url":"https://api.github.com/users/backbee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/backbee/subscriptions","organizations_url":"https://api.github.com/users/backbee/orgs","repos_url":"https://api.github.com/users/backbee/repos","events_url":"https://api.github.com/users/backbee/events{/privacy}","received_events_url":"https://api.github.com/users/backbee/received_events","type":"Organization","site_admin":false},"repo":{"id":21970893,"name":"BackBee","full_name":"backbee/BackBee","owner":{"login":"backbee","id":8198689,"avatar_url":"https://avatars.githubusercontent.com/u/8198689?v=3","gravatar_id":"","url":"https://api.github.com/users/backbee","html_url":"https://github.com/backbee","followers_url":"https://api.github.com/users/backbee/followers","following_url":"https://api.github.com/users/backbee/following{/other_user}","gists_url":"https://api.github.com/users/backbee/gists{/gist_id}","starred_url":"https://api.github.com/users/backbee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/backbee/subscriptions","organizations_url":"https://api.github.com/users/backbee/orgs","repos_url":"https://api.github.com/users/backbee/repos","events_url":"https://api.github.com/users/backbee/events{/privacy}","received_events_url":"https://api.github.com/users/backbee/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/backbee/BackBee","description":"BackBee, the Next Generation Open-Source CMS","fork":false,"url":"https://api.github.com/repos/backbee/BackBee","forks_url":"https://api.github.com/repos/backbee/BackBee/forks","keys_url":"https://api.github.com/repos/backbee/BackBee/keys{/key_id}","collaborators_url":"https://api.github.com/repos/backbee/BackBee/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/backbee/BackBee/teams","hooks_url":"https://api.github.com/repos/backbee/BackBee/hooks","issue_events_url":"https://api.github.com/repos/backbee/BackBee/issues/events{/number}","events_url":"https://api.github.com/repos/backbee/BackBee/events","assignees_url":"https://api.github.com/repos/backbee/BackBee/assignees{/user}","branches_url":"https://api.github.com/repos/backbee/BackBee/branches{/branch}","tags_url":"https://api.github.com/repos/backbee/BackBee/tags","blobs_url":"https://api.github.com/repos/backbee/BackBee/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/backbee/BackBee/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/backbee/BackBee/git/refs{/sha}","trees_url":"https://api.github.com/repos/backbee/BackBee/git/trees{/sha}","statuses_url":"https://api.github.com/repos/backbee/BackBee/statuses/{sha}","languages_url":"https://api.github.com/repos/backbee/BackBee/languages","stargazers_url":"https://api.github.com/repos/backbee/BackBee/stargazers","contributors_url":"https://api.github.com/repos/backbee/BackBee/contributors","subscribers_url":"https://api.github.com/repos/backbee/BackBee/subscribers","subscription_url":"https://api.github.com/repos/backbee/BackBee/subscription","commits_url":"https://api.github.com/repos/backbee/BackBee/commits{/sha}","git_commits_url":"https://api.github.com/repos/backbee/BackBee/git/commits{/sha}","comments_url":"https://api.github.com/repos/backbee/BackBee/comments{/number}","issue_comment_url":"https://api.github.com/repos/backbee/BackBee/issues/comments/{number}","contents_url":"https://api.github.com/repos/backbee/BackBee/contents/{+path}","compare_url":"https://api.github.com/repos/backbee/BackBee/compare/{base}...{head}","merges_url":"https://api.github.com/repos/backbee/BackBee/merges","archive_url":"https://api.github.com/repos/backbee/BackBee/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/backbee/BackBee/downloads","issues_url":"https://api.github.com/repos/backbee/BackBee/issues{/number}","pulls_url":"https://api.github.com/repos/backbee/BackBee/pulls{/number}","milestones_url":"https://api.github.com/repos/backbee/BackBee/milestones{/number}","notifications_url":"https://api.github.com/repos/backbee/BackBee/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/backbee/BackBee/labels{/name}","releases_url":"https://api.github.com/repos/backbee/BackBee/releases{/id}","created_at":"2014-07-18T06:51:12Z","updated_at":"2015-01-21T13:57:24Z","pushed_at":"2015-01-23T14:14:16Z","git_url":"git://github.com/backbee/BackBee.git","ssh_url":"git@github.com:backbee/BackBee.git","clone_url":"https://github.com/backbee/BackBee.git","svn_url":"https://github.com/backbee/BackBee","homepage":null,"size":26378,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":90,"forks":2,"open_issues":90,"watchers":6,"default_branch":"master"}},"base":{"label":"backbee:master","ref":"master","sha":"1050e5963894ca26f97da58e9100f28c04303482","user":{"login":"backbee","id":8198689,"avatar_url":"https://avatars.githubusercontent.com/u/8198689?v=3","gravatar_id":"","url":"https://api.github.com/users/backbee","html_url":"https://github.com/backbee","followers_url":"https://api.github.com/users/backbee/followers","following_url":"https://api.github.com/users/backbee/following{/other_user}","gists_url":"https://api.github.com/users/backbee/gists{/gist_id}","starred_url":"https://api.github.com/users/backbee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/backbee/subscriptions","organizations_url":"https://api.github.com/users/backbee/orgs","repos_url":"https://api.github.com/users/backbee/repos","events_url":"https://api.github.com/users/backbee/events{/privacy}","received_events_url":"https://api.github.com/users/backbee/received_events","type":"Organization","site_admin":false},"repo":{"id":21970893,"name":"BackBee","full_name":"backbee/BackBee","owner":{"login":"backbee","id":8198689,"avatar_url":"https://avatars.githubusercontent.com/u/8198689?v=3","gravatar_id":"","url":"https://api.github.com/users/backbee","html_url":"https://github.com/backbee","followers_url":"https://api.github.com/users/backbee/followers","following_url":"https://api.github.com/users/backbee/following{/other_user}","gists_url":"https://api.github.com/users/backbee/gists{/gist_id}","starred_url":"https://api.github.com/users/backbee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/backbee/subscriptions","organizations_url":"https://api.github.com/users/backbee/orgs","repos_url":"https://api.github.com/users/backbee/repos","events_url":"https://api.github.com/users/backbee/events{/privacy}","received_events_url":"https://api.github.com/users/backbee/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/backbee/BackBee","description":"BackBee, the Next Generation Open-Source CMS","fork":false,"url":"https://api.github.com/repos/backbee/BackBee","forks_url":"https://api.github.com/repos/backbee/BackBee/forks","keys_url":"https://api.github.com/repos/backbee/BackBee/keys{/key_id}","collaborators_url":"https://api.github.com/repos/backbee/BackBee/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/backbee/BackBee/teams","hooks_url":"https://api.github.com/repos/backbee/BackBee/hooks","issue_events_url":"https://api.github.com/repos/backbee/BackBee/issues/events{/number}","events_url":"https://api.github.com/repos/backbee/BackBee/events","assignees_url":"https://api.github.com/repos/backbee/BackBee/assignees{/user}","branches_url":"https://api.github.com/repos/backbee/BackBee/branches{/branch}","tags_url":"https://api.github.com/repos/backbee/BackBee/tags","blobs_url":"https://api.github.com/repos/backbee/BackBee/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/backbee/BackBee/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/backbee/BackBee/git/refs{/sha}","trees_url":"https://api.github.com/repos/backbee/BackBee/git/trees{/sha}","statuses_url":"https://api.github.com/repos/backbee/BackBee/statuses/{sha}","languages_url":"https://api.github.com/repos/backbee/BackBee/languages","stargazers_url":"https://api.github.com/repos/backbee/BackBee/stargazers","contributors_url":"https://api.github.com/repos/backbee/BackBee/contributors","subscribers_url":"https://api.github.com/repos/backbee/BackBee/subscribers","subscription_url":"https://api.github.com/repos/backbee/BackBee/subscription","commits_url":"https://api.github.com/repos/backbee/BackBee/commits{/sha}","git_commits_url":"https://api.github.com/repos/backbee/BackBee/git/commits{/sha}","comments_url":"https://api.github.com/repos/backbee/BackBee/comments{/number}","issue_comment_url":"https://api.github.com/repos/backbee/BackBee/issues/comments/{number}","contents_url":"https://api.github.com/repos/backbee/BackBee/contents/{+path}","compare_url":"https://api.github.com/repos/backbee/BackBee/compare/{base}...{head}","merges_url":"https://api.github.com/repos/backbee/BackBee/merges","archive_url":"https://api.github.com/repos/backbee/BackBee/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/backbee/BackBee/downloads","issues_url":"https://api.github.com/repos/backbee/BackBee/issues{/number}","pulls_url":"https://api.github.com/repos/backbee/BackBee/pulls{/number}","milestones_url":"https://api.github.com/repos/backbee/BackBee/milestones{/number}","notifications_url":"https://api.github.com/repos/backbee/BackBee/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/backbee/BackBee/labels{/name}","releases_url":"https://api.github.com/repos/backbee/BackBee/releases{/id}","created_at":"2014-07-18T06:51:12Z","updated_at":"2015-01-21T13:57:24Z","pushed_at":"2015-01-23T14:14:16Z","git_url":"git://github.com/backbee/BackBee.git","ssh_url":"git@github.com:backbee/BackBee.git","clone_url":"https://github.com/backbee/BackBee.git","svn_url":"https://github.com/backbee/BackBee","homepage":null,"size":26378,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":90,"forks":2,"open_issues":90,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/backbee/BackBee/pulls/211"},"html":{"href":"https://github.com/backbee/BackBee/pull/211"},"issue":{"href":"https://api.github.com/repos/backbee/BackBee/issues/211"},"comments":{"href":"https://api.github.com/repos/backbee/BackBee/issues/211/comments"},"review_comments":{"href":"https://api.github.com/repos/backbee/BackBee/pulls/211/comments"},"review_comment":{"href":"https://api.github.com/repos/backbee/BackBee/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/backbee/BackBee/pulls/211/commits"},"statuses":{"href":"https://api.github.com/repos/backbee/BackBee/statuses/27f873d02cf169f6b335f4aa5159542e116103bc"}}}}