{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments/244135766","pull_request_review_id":188067948,"id":244135766,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDEzNTc2Ng==","diff_hunk":"@@ -279,6 +279,34 @@ you can pass the class name and the method as an array.\n             }\n         }\n \n+Supplying the Choices from an Array Constant\n+-------------------------------------------\n+\n+You can also directly provide an array constant to the ``choices`` option in the annotation::\n+\n+    // src/AppBundle/Entity/Author.php\n+    namespace AppBundle\\Entity;\n+\n+    class Author\n+    {\n+        const GENRES = ['fiction', 'non-fiction'];\n+\n+        /**\n+         * @Assert\\Choice(choices=Author::GENRES)\n+         */\n+        protected $genre;\n+    }\n+\n+.. warning::\n+\n+  Notice that the constant in the option is used without quotes\n+\n+.. note::\n+\n+  If the constant is stored in a different class, you can pass the fully qualified class name","path":"reference/constraints/Choice.rst","position":28,"original_position":28,"commit_id":"5920576ed8055662c21555326b7334172fd7b5fb","original_commit_id":"5920576ed8055662c21555326b7334172fd7b5fb","user":{"login":"HeahDude","id":10107633,"node_id":"MDQ6VXNlcjEwMTA3NjMz","avatar_url":"https://avatars0.githubusercontent.com/u/10107633?v=4","gravatar_id":"","url":"https://api.github.com/users/HeahDude","html_url":"https://github.com/HeahDude","followers_url":"https://api.github.com/users/HeahDude/followers","following_url":"https://api.github.com/users/HeahDude/following{/other_user}","gists_url":"https://api.github.com/users/HeahDude/gists{/gist_id}","starred_url":"https://api.github.com/users/HeahDude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeahDude/subscriptions","organizations_url":"https://api.github.com/users/HeahDude/orgs","repos_url":"https://api.github.com/users/HeahDude/repos","events_url":"https://api.github.com/users/HeahDude/events{/privacy}","received_events_url":"https://api.github.com/users/HeahDude/received_events","type":"User","site_admin":false},"body":"What about `defined` instead of `stored`?","created_at":"2018-12-27T11:30:44Z","updated_at":"2018-12-27T11:30:59Z","html_url":"https://github.com/symfony/symfony-docs/pull/10810#discussion_r244135766","pull_request_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/10810","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments/244135766"},"html":{"href":"https://github.com/symfony/symfony-docs/pull/10810#discussion_r244135766"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/10810"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony-docs/pulls/10810","id":241133905,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxMTMzOTA1","html_url":"https://github.com/symfony/symfony-docs/pull/10810","diff_url":"https://github.com/symfony/symfony-docs/pull/10810.diff","patch_url":"https://github.com/symfony/symfony-docs/pull/10810.patch","issue_url":"https://api.github.com/repos/symfony/symfony-docs/issues/10810","number":10810,"state":"open","locked":false,"title":"validator : choice constraint : explain how to supply choices from an array constant","user":{"login":"nikophil","id":10139766,"node_id":"MDQ6VXNlcjEwMTM5NzY2","avatar_url":"https://avatars0.githubusercontent.com/u/10139766?v=4","gravatar_id":"","url":"https://api.github.com/users/nikophil","html_url":"https://github.com/nikophil","followers_url":"https://api.github.com/users/nikophil/followers","following_url":"https://api.github.com/users/nikophil/following{/other_user}","gists_url":"https://api.github.com/users/nikophil/gists{/gist_id}","starred_url":"https://api.github.com/users/nikophil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikophil/subscriptions","organizations_url":"https://api.github.com/users/nikophil/orgs","repos_url":"https://api.github.com/users/nikophil/repos","events_url":"https://api.github.com/users/nikophil/events{/privacy}","received_events_url":"https://api.github.com/users/nikophil/received_events","type":"User","site_admin":false},"body":"Hi,\r\n\r\nfew days ago i tried to add a new feature to the `choice` validator constraint, by adding a new `choicesFromConstant` option.\r\nhttps://github.com/symfony/symfony/pull/29658\r\nBut then, i realized this was already supported.\r\n\r\nI think this should be documented, as i think a lot of people don't know this feature.\r\n\r\nthanks.\r\n","created_at":"2018-12-27T11:28:24Z","updated_at":"2018-12-27T11:30:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cdfb57e06ee82a929a2ee6bddcff11327b044ed5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":32958317,"node_id":"MDU6TGFiZWwzMjk1ODMxNw==","url":"https://api.github.com/repos/symfony/symfony-docs/labels/Form","name":"Form","color":"DDDDDD","default":false},{"id":390692613,"node_id":"MDU6TGFiZWwzOTA2OTI2MTM=","url":"https://api.github.com/repos/symfony/symfony-docs/labels/Status:%20Needs%20Review","name":"Status: Needs Review","color":"1d76db","default":false}],"milestone":{"url":"https://api.github.com/repos/symfony/symfony-docs/milestones/14","html_url":"https://github.com/symfony/symfony-docs/milestone/14","labels_url":"https://api.github.com/repos/symfony/symfony-docs/milestones/14/labels","id":2458541,"node_id":"MDk6TWlsZXN0b25lMjQ1ODU0MQ==","number":14,"title":"3.4","description":"","creator":{"login":"HeahDude","id":10107633,"node_id":"MDQ6VXNlcjEwMTA3NjMz","avatar_url":"https://avatars0.githubusercontent.com/u/10107633?v=4","gravatar_id":"","url":"https://api.github.com/users/HeahDude","html_url":"https://github.com/HeahDude","followers_url":"https://api.github.com/users/HeahDude/followers","following_url":"https://api.github.com/users/HeahDude/following{/other_user}","gists_url":"https://api.github.com/users/HeahDude/gists{/gist_id}","starred_url":"https://api.github.com/users/HeahDude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeahDude/subscriptions","organizations_url":"https://api.github.com/users/HeahDude/orgs","repos_url":"https://api.github.com/users/HeahDude/repos","events_url":"https://api.github.com/users/HeahDude/events{/privacy}","received_events_url":"https://api.github.com/users/HeahDude/received_events","type":"User","site_admin":false},"open_issues":36,"closed_issues":424,"state":"open","created_at":"2017-04-15T13:02:34Z","updated_at":"2018-12-27T11:29:30Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/10810/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/10810/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony-docs/issues/10810/comments","statuses_url":"https://api.github.com/repos/symfony/symfony-docs/statuses/5920576ed8055662c21555326b7334172fd7b5fb","head":{"label":"nikophil:validator_choices_from_constant","ref":"validator_choices_from_constant","sha":"5920576ed8055662c21555326b7334172fd7b5fb","user":{"login":"nikophil","id":10139766,"node_id":"MDQ6VXNlcjEwMTM5NzY2","avatar_url":"https://avatars0.githubusercontent.com/u/10139766?v=4","gravatar_id":"","url":"https://api.github.com/users/nikophil","html_url":"https://github.com/nikophil","followers_url":"https://api.github.com/users/nikophil/followers","following_url":"https://api.github.com/users/nikophil/following{/other_user}","gists_url":"https://api.github.com/users/nikophil/gists{/gist_id}","starred_url":"https://api.github.com/users/nikophil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikophil/subscriptions","organizations_url":"https://api.github.com/users/nikophil/orgs","repos_url":"https://api.github.com/users/nikophil/repos","events_url":"https://api.github.com/users/nikophil/events{/privacy}","received_events_url":"https://api.github.com/users/nikophil/received_events","type":"User","site_admin":false},"repo":{"id":163281678,"node_id":"MDEwOlJlcG9zaXRvcnkxNjMyODE2Nzg=","name":"symfony-docs","full_name":"nikophil/symfony-docs","private":false,"owner":{"login":"nikophil","id":10139766,"node_id":"MDQ6VXNlcjEwMTM5NzY2","avatar_url":"https://avatars0.githubusercontent.com/u/10139766?v=4","gravatar_id":"","url":"https://api.github.com/users/nikophil","html_url":"https://github.com/nikophil","followers_url":"https://api.github.com/users/nikophil/followers","following_url":"https://api.github.com/users/nikophil/following{/other_user}","gists_url":"https://api.github.com/users/nikophil/gists{/gist_id}","starred_url":"https://api.github.com/users/nikophil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikophil/subscriptions","organizations_url":"https://api.github.com/users/nikophil/orgs","repos_url":"https://api.github.com/users/nikophil/repos","events_url":"https://api.github.com/users/nikophil/events{/privacy}","received_events_url":"https://api.github.com/users/nikophil/received_events","type":"User","site_admin":false},"html_url":"https://github.com/nikophil/symfony-docs","description":"The Symfony documentation","fork":true,"url":"https://api.github.com/repos/nikophil/symfony-docs","forks_url":"https://api.github.com/repos/nikophil/symfony-docs/forks","keys_url":"https://api.github.com/repos/nikophil/symfony-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nikophil/symfony-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nikophil/symfony-docs/teams","hooks_url":"https://api.github.com/repos/nikophil/symfony-docs/hooks","issue_events_url":"https://api.github.com/repos/nikophil/symfony-docs/issues/events{/number}","events_url":"https://api.github.com/repos/nikophil/symfony-docs/events","assignees_url":"https://api.github.com/repos/nikophil/symfony-docs/assignees{/user}","branches_url":"https://api.github.com/repos/nikophil/symfony-docs/branches{/branch}","tags_url":"https://api.github.com/repos/nikophil/symfony-docs/tags","blobs_url":"https://api.github.com/repos/nikophil/symfony-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nikophil/symfony-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nikophil/symfony-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/nikophil/symfony-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nikophil/symfony-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/nikophil/symfony-docs/languages","stargazers_url":"https://api.github.com/repos/nikophil/symfony-docs/stargazers","contributors_url":"https://api.github.com/repos/nikophil/symfony-docs/contributors","subscribers_url":"https://api.github.com/repos/nikophil/symfony-docs/subscribers","subscription_url":"https://api.github.com/repos/nikophil/symfony-docs/subscription","commits_url":"https://api.github.com/repos/nikophil/symfony-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/nikophil/symfony-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/nikophil/symfony-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/nikophil/symfony-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/nikophil/symfony-docs/contents/{+path}","compare_url":"https://api.github.com/repos/nikophil/symfony-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nikophil/symfony-docs/merges","archive_url":"https://api.github.com/repos/nikophil/symfony-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nikophil/symfony-docs/downloads","issues_url":"https://api.github.com/repos/nikophil/symfony-docs/issues{/number}","pulls_url":"https://api.github.com/repos/nikophil/symfony-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/nikophil/symfony-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/nikophil/symfony-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nikophil/symfony-docs/labels{/name}","releases_url":"https://api.github.com/repos/nikophil/symfony-docs/releases{/id}","deployments_url":"https://api.github.com/repos/nikophil/symfony-docs/deployments","created_at":"2018-12-27T10:34:28Z","updated_at":"2018-12-27T10:34:34Z","pushed_at":"2018-12-27T11:24:46Z","git_url":"git://github.com/nikophil/symfony-docs.git","ssh_url":"git@github.com:nikophil/symfony-docs.git","clone_url":"https://github.com/nikophil/symfony-docs.git","svn_url":"https://github.com/nikophil/symfony-docs","homepage":"https://symfony.com/doc","size":51528,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"symfony:3.4","ref":"3.4","sha":"239136de4e6bfec4b307e06e1431d84a726196d3","user":{"login":"symfony","id":143937,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MzkzNw==","avatar_url":"https://avatars3.githubusercontent.com/u/143937?v=4","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":521583,"node_id":"MDEwOlJlcG9zaXRvcnk1MjE1ODM=","name":"symfony-docs","full_name":"symfony/symfony-docs","private":false,"owner":{"login":"symfony","id":143937,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MzkzNw==","avatar_url":"https://avatars3.githubusercontent.com/u/143937?v=4","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/symfony/symfony-docs","description":"The Symfony documentation","fork":false,"url":"https://api.github.com/repos/symfony/symfony-docs","forks_url":"https://api.github.com/repos/symfony/symfony-docs/forks","keys_url":"https://api.github.com/repos/symfony/symfony-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony-docs/teams","hooks_url":"https://api.github.com/repos/symfony/symfony-docs/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony-docs/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony-docs/events","assignees_url":"https://api.github.com/repos/symfony/symfony-docs/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony-docs/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony-docs/tags","blobs_url":"https://api.github.com/repos/symfony/symfony-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony-docs/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony-docs/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony-docs/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony-docs/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony-docs/subscription","commits_url":"https://api.github.com/repos/symfony/symfony-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/symfony-docs/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony-docs/merges","archive_url":"https://api.github.com/repos/symfony/symfony-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony-docs/downloads","issues_url":"https://api.github.com/repos/symfony/symfony-docs/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony-docs/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony-docs/releases{/id}","deployments_url":"https://api.github.com/repos/symfony/symfony-docs/deployments","created_at":"2010-02-17T08:43:51Z","updated_at":"2018-12-26T08:26:57Z","pushed_at":"2018-12-27T11:28:25Z","git_url":"git://github.com/symfony/symfony-docs.git","ssh_url":"git@github.com:symfony/symfony-docs.git","clone_url":"https://github.com/symfony/symfony-docs.git","svn_url":"https://github.com/symfony/symfony-docs","homepage":"https://symfony.com/doc","size":51528,"stargazers_count":1524,"watchers_count":1524,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":3801,"mirror_url":null,"archived":false,"open_issues_count":342,"license":null,"forks":3801,"open_issues":342,"watchers":1524,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/10810"},"html":{"href":"https://github.com/symfony/symfony-docs/pull/10810"},"issue":{"href":"https://api.github.com/repos/symfony/symfony-docs/issues/10810"},"comments":{"href":"https://api.github.com/repos/symfony/symfony-docs/issues/10810/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/10810/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/10810/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony-docs/statuses/5920576ed8055662c21555326b7334172fd7b5fb"}},"author_association":"NONE"}}
{"actor":{"display_login":"HeahDude"}}