{"action":"reopened","number":2977,"pull_request":{"url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/2977","id":35004292,"html_url":"https://github.com/sonata-project/SonataAdminBundle/pull/2977","diff_url":"https://github.com/sonata-project/SonataAdminBundle/pull/2977.diff","patch_url":"https://github.com/sonata-project/SonataAdminBundle/pull/2977.patch","issue_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/2977","number":2977,"state":"open","locked":false,"title":"Restructure CRUDController::createAction()","user":{"login":"aderuwe","id":1125184,"avatar_url":"https://avatars.githubusercontent.com/u/1125184?v=3","gravatar_id":"","url":"https://api.github.com/users/aderuwe","html_url":"https://github.com/aderuwe","followers_url":"https://api.github.com/users/aderuwe/followers","following_url":"https://api.github.com/users/aderuwe/following{/other_user}","gists_url":"https://api.github.com/users/aderuwe/gists{/gist_id}","starred_url":"https://api.github.com/users/aderuwe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aderuwe/subscriptions","organizations_url":"https://api.github.com/users/aderuwe/orgs","repos_url":"https://api.github.com/users/aderuwe/repos","events_url":"https://api.github.com/users/aderuwe/events{/privacy}","received_events_url":"https://api.github.com/users/aderuwe/received_events","type":"User","site_admin":false},"body":"This way the entity can be produced by the form's empty_data closure:\r\n\r\n``` php\r\nprotected function configureFormFields(FormMapper $formMapper)\r\n{\r\n    $formMapper\r\n        ->add('otherEntity')\r\n    ;\r\n\r\n    $formBuilder = $formMapper->getFormBuilder();\r\n    $formBuilder->setEmptyData(function (FormInterface $form) {\r\n        return new Entity($form->get('otherEntity')->getData());\r\n    });\r\n}\r\n```\r\n\r\nIn turn, that means that entities taking constructor arguments are supported.\r\n\r\nHowever, I'm not sure if this breaks other stuff - it doesn't seem to in my tests...\r\n\r\nI've not updated the unit tests yet ... I'm looking for feedback first.","created_at":"2015-05-08T12:27:37Z","updated_at":"2015-07-01T15:37:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"292cf238397e621d92b249671357e4ee5eb7d852","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/2977/commits","review_comments_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/2977/comments","review_comment_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/2977/comments","statuses_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/statuses/c8bb88d09402bb781a1cc6e9453a633ec9ca6328","head":{"label":"aderuwe:support-empty-data","ref":"support-empty-data","sha":"c8bb88d09402bb781a1cc6e9453a633ec9ca6328","user":{"login":"aderuwe","id":1125184,"avatar_url":"https://avatars.githubusercontent.com/u/1125184?v=3","gravatar_id":"","url":"https://api.github.com/users/aderuwe","html_url":"https://github.com/aderuwe","followers_url":"https://api.github.com/users/aderuwe/followers","following_url":"https://api.github.com/users/aderuwe/following{/other_user}","gists_url":"https://api.github.com/users/aderuwe/gists{/gist_id}","starred_url":"https://api.github.com/users/aderuwe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aderuwe/subscriptions","organizations_url":"https://api.github.com/users/aderuwe/orgs","repos_url":"https://api.github.com/users/aderuwe/repos","events_url":"https://api.github.com/users/aderuwe/events{/privacy}","received_events_url":"https://api.github.com/users/aderuwe/received_events","type":"User","site_admin":false},"repo":{"id":35277074,"name":"SonataAdminBundle","full_name":"aderuwe/SonataAdminBundle","owner":{"login":"aderuwe","id":1125184,"avatar_url":"https://avatars.githubusercontent.com/u/1125184?v=3","gravatar_id":"","url":"https://api.github.com/users/aderuwe","html_url":"https://github.com/aderuwe","followers_url":"https://api.github.com/users/aderuwe/followers","following_url":"https://api.github.com/users/aderuwe/following{/other_user}","gists_url":"https://api.github.com/users/aderuwe/gists{/gist_id}","starred_url":"https://api.github.com/users/aderuwe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aderuwe/subscriptions","organizations_url":"https://api.github.com/users/aderuwe/orgs","repos_url":"https://api.github.com/users/aderuwe/repos","events_url":"https://api.github.com/users/aderuwe/events{/privacy}","received_events_url":"https://api.github.com/users/aderuwe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aderuwe/SonataAdminBundle","description":"AdminBundle - The missing Symfony2 Admin Generator","fork":true,"url":"https://api.github.com/repos/aderuwe/SonataAdminBundle","forks_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/forks","keys_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/teams","hooks_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/hooks","issue_events_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/issues/events{/number}","events_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/events","assignees_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/assignees{/user}","branches_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/branches{/branch}","tags_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/tags","blobs_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/languages","stargazers_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/stargazers","contributors_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/contributors","subscribers_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/subscribers","subscription_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/subscription","commits_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/contents/{+path}","compare_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/merges","archive_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/downloads","issues_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/issues{/number}","pulls_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/labels{/name}","releases_url":"https://api.github.com/repos/aderuwe/SonataAdminBundle/releases{/id}","created_at":"2015-05-08T12:02:08Z","updated_at":"2015-05-08T12:02:10Z","pushed_at":"2015-05-08T12:22:37Z","git_url":"git://github.com/aderuwe/SonataAdminBundle.git","ssh_url":"git@github.com:aderuwe/SonataAdminBundle.git","clone_url":"https://github.com/aderuwe/SonataAdminBundle.git","svn_url":"https://github.com/aderuwe/SonataAdminBundle","homepage":"http://sonata-project.org/bundles/admin","size":15196,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"sonata-project:master","ref":"master","sha":"1a4c53d0da0aab9a945a53b7c7f415c4cec41b7b","user":{"login":"sonata-project","id":404157,"avatar_url":"https://avatars.githubusercontent.com/u/404157?v=3","gravatar_id":"","url":"https://api.github.com/users/sonata-project","html_url":"https://github.com/sonata-project","followers_url":"https://api.github.com/users/sonata-project/followers","following_url":"https://api.github.com/users/sonata-project/following{/other_user}","gists_url":"https://api.github.com/users/sonata-project/gists{/gist_id}","starred_url":"https://api.github.com/users/sonata-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonata-project/subscriptions","organizations_url":"https://api.github.com/users/sonata-project/orgs","repos_url":"https://api.github.com/users/sonata-project/repos","events_url":"https://api.github.com/users/sonata-project/events{/privacy}","received_events_url":"https://api.github.com/users/sonata-project/received_events","type":"Organization","site_admin":false},"repo":{"id":1095228,"name":"SonataAdminBundle","full_name":"sonata-project/SonataAdminBundle","owner":{"login":"sonata-project","id":404157,"avatar_url":"https://avatars.githubusercontent.com/u/404157?v=3","gravatar_id":"","url":"https://api.github.com/users/sonata-project","html_url":"https://github.com/sonata-project","followers_url":"https://api.github.com/users/sonata-project/followers","following_url":"https://api.github.com/users/sonata-project/following{/other_user}","gists_url":"https://api.github.com/users/sonata-project/gists{/gist_id}","starred_url":"https://api.github.com/users/sonata-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonata-project/subscriptions","organizations_url":"https://api.github.com/users/sonata-project/orgs","repos_url":"https://api.github.com/users/sonata-project/repos","events_url":"https://api.github.com/users/sonata-project/events{/privacy}","received_events_url":"https://api.github.com/users/sonata-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sonata-project/SonataAdminBundle","description":"AdminBundle - The missing Symfony2 Admin Generator","fork":false,"url":"https://api.github.com/repos/sonata-project/SonataAdminBundle","forks_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/forks","keys_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/teams","hooks_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/hooks","issue_events_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/events{/number}","events_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/events","assignees_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/assignees{/user}","branches_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/branches{/branch}","tags_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/tags","blobs_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/languages","stargazers_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/stargazers","contributors_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/contributors","subscribers_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/subscribers","subscription_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/subscription","commits_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/contents/{+path}","compare_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/merges","archive_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/downloads","issues_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues{/number}","pulls_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/labels{/name}","releases_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/releases{/id}","created_at":"2010-11-19T17:08:52Z","updated_at":"2015-07-01T08:35:42Z","pushed_at":"2015-07-01T14:20:00Z","git_url":"git://github.com/sonata-project/SonataAdminBundle.git","ssh_url":"git@github.com:sonata-project/SonataAdminBundle.git","clone_url":"https://github.com/sonata-project/SonataAdminBundle.git","svn_url":"https://github.com/sonata-project/SonataAdminBundle","homepage":"http://sonata-project.org/bundles/admin","size":25990,"stargazers_count":1203,"watchers_count":1203,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":836,"mirror_url":null,"open_issues_count":423,"forks":836,"open_issues":423,"watchers":1203,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/2977"},"html":{"href":"https://github.com/sonata-project/SonataAdminBundle/pull/2977"},"issue":{"href":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/2977"},"comments":{"href":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/2977/comments"},"review_comments":{"href":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/2977/comments"},"review_comment":{"href":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/2977/commits"},"statuses":{"href":"https://api.github.com/repos/sonata-project/SonataAdminBundle/statuses/c8bb88d09402bb781a1cc6e9453a633ec9ca6328"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":11,"review_comments":0,"commits":1,"additions":4,"deletions":4,"changed_files":1}}