{"action":"created","issue":{"url":"https://api.github.com/repos/doctrine/DoctrineModule/issues/502","labels_url":"https://api.github.com/repos/doctrine/DoctrineModule/issues/502/labels{/name}","comments_url":"https://api.github.com/repos/doctrine/DoctrineModule/issues/502/comments","events_url":"https://api.github.com/repos/doctrine/DoctrineModule/issues/502/events","html_url":"https://github.com/doctrine/DoctrineModule/pull/502","id":72442595,"number":502,"title":"Feature/optgroup support","user":{"login":"manuakasam","id":1087280,"avatar_url":"https://avatars.githubusercontent.com/u/1087280?v=3","gravatar_id":"","url":"https://api.github.com/users/manuakasam","html_url":"https://github.com/manuakasam","followers_url":"https://api.github.com/users/manuakasam/followers","following_url":"https://api.github.com/users/manuakasam/following{/other_user}","gists_url":"https://api.github.com/users/manuakasam/gists{/gist_id}","starred_url":"https://api.github.com/users/manuakasam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuakasam/subscriptions","organizations_url":"https://api.github.com/users/manuakasam/orgs","repos_url":"https://api.github.com/users/manuakasam/repos","events_url":"https://api.github.com/users/manuakasam/events{/privacy}","received_events_url":"https://api.github.com/users/manuakasam/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-01T14:24:13Z","updated_at":"2015-05-04T21:49:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/doctrine/DoctrineModule/pulls/502","html_url":"https://github.com/doctrine/DoctrineModule/pull/502","diff_url":"https://github.com/doctrine/DoctrineModule/pull/502.diff","patch_url":"https://github.com/doctrine/DoctrineModule/pull/502.patch"},"body":"References #370 \r\n\r\n@gianarb this would be the first set of feature with which adding is not any danger at all I feel.\r\n\r\nHowever there's still one thing that I wouldn't see as \"that awesome\".\r\n\r\nWhen your data-structure \"optgroup\" is empty or null it will create an optgroup that has no title. While this is somewhat OK it would likely be more valid to put those empty optgroup entries within NO optgroup block at all.\r\n\r\nA further alternative is to provide yet another option key `optgroup_default` where you could define what happens to empty optgroup elements. I.e. `'optgroup_default' => 'Others'` would name the empty group \"Others\".\r\n\r\nThe above functionality is already implemented in my branch. You can check it out here:\r\nhttps://github.com/manuakasam/DoctrineModule/blob/feature/optgroup-default-container/src/DoctrineModule/Form/Element/Proxy.php#L617-L630\r\n\r\nThe downside to this is that this is quite a lot of custom code. While fully functional you may consider this too custom and not for a wide enough audience? Just gimme your thouhgt. If it's considered OK, ill write tests for those as well and hit up a follow up PR after this."},"comment":{"url":"https://api.github.com/repos/doctrine/DoctrineModule/issues/comments/98857828","html_url":"https://github.com/doctrine/DoctrineModule/pull/502#issuecomment-98857828","issue_url":"https://api.github.com/repos/doctrine/DoctrineModule/issues/502","id":98857828,"user":{"login":"manuakasam","id":1087280,"avatar_url":"https://avatars.githubusercontent.com/u/1087280?v=3","gravatar_id":"","url":"https://api.github.com/users/manuakasam","html_url":"https://github.com/manuakasam","followers_url":"https://api.github.com/users/manuakasam/followers","following_url":"https://api.github.com/users/manuakasam/following{/other_user}","gists_url":"https://api.github.com/users/manuakasam/gists{/gist_id}","starred_url":"https://api.github.com/users/manuakasam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuakasam/subscriptions","organizations_url":"https://api.github.com/users/manuakasam/orgs","repos_url":"https://api.github.com/users/manuakasam/repos","events_url":"https://api.github.com/users/manuakasam/events{/privacy}","received_events_url":"https://api.github.com/users/manuakasam/received_events","type":"User","site_admin":false},"created_at":"2015-05-04T21:49:56Z","updated_at":"2015-05-04T21:49:56Z","body":"Added the default group handling. Still missing the documentation for that though. Also need more feedback on the proper code-styling of `(string)$foo` vs. `(string) $foo` as well as codeblocks for `@var string` vs. `@var string|null`."}}