{"action":"created","comment":{"url":"https://api.github.com/repos/doctrine/phpcr-odm/pulls/comments/65489480","id":65489480,"diff_hunk":"@@ -329,6 +329,13 @@ class ClassMetadata implements ClassMetadataInterface\n     public $parentClasses = array();\n \n     /**\n+     * READ-ONLY: Child class restrictions.\n+     *\n+     * @var array\n+     */\n+    public $childRestrictions = null;","path":"lib/Doctrine/ODM/PHPCR/Mapping/ClassMetadata.php","position":8,"original_position":8,"commit_id":"1e084bf66f1bbd707c97d37e72a3fbfadce51d8a","original_commit_id":"1e084bf66f1bbd707c97d37e72a3fbfadce51d8a","user":{"login":"dbu","id":76576,"avatar_url":"https://avatars.githubusercontent.com/u/76576?v=3","gravatar_id":"","url":"https://api.github.com/users/dbu","html_url":"https://github.com/dbu","followers_url":"https://api.github.com/users/dbu/followers","following_url":"https://api.github.com/users/dbu/following{/other_user}","gists_url":"https://api.github.com/users/dbu/gists{/gist_id}","starred_url":"https://api.github.com/users/dbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbu/subscriptions","organizations_url":"https://api.github.com/users/dbu/orgs","repos_url":"https://api.github.com/users/dbu/repos","events_url":"https://api.github.com/users/dbu/events{/privacy}","received_events_url":"https://api.github.com/users/dbu/received_events","type":"User","site_admin":false},"body":"child or children? not sure which is the correct way. its the restriction on each child...","created_at":"2016-06-02T06:24:31Z","updated_at":"2016-06-02T06:24:31Z","html_url":"https://github.com/doctrine/phpcr-odm/pull/706#discussion_r65489480","pull_request_url":"https://api.github.com/repos/doctrine/phpcr-odm/pulls/706","_links":{"self":{"href":"https://api.github.com/repos/doctrine/phpcr-odm/pulls/comments/65489480"},"html":{"href":"https://github.com/doctrine/phpcr-odm/pull/706#discussion_r65489480"},"pull_request":{"href":"https://api.github.com/repos/doctrine/phpcr-odm/pulls/706"}}},"pull_request":{"url":"https://api.github.com/repos/doctrine/phpcr-odm/pulls/706","id":71875991,"html_url":"https://github.com/doctrine/phpcr-odm/pull/706","diff_url":"https://github.com/doctrine/phpcr-odm/pull/706.diff","patch_url":"https://github.com/doctrine/phpcr-odm/pull/706.patch","issue_url":"https://api.github.com/repos/doctrine/phpcr-odm/issues/706","number":706,"state":"open","locked":false,"title":"Support child restriction","user":{"login":"dantleech","id":530801,"avatar_url":"https://avatars.githubusercontent.com/u/530801?v=3","gravatar_id":"","url":"https://api.github.com/users/dantleech","html_url":"https://github.com/dantleech","followers_url":"https://api.github.com/users/dantleech/followers","following_url":"https://api.github.com/users/dantleech/following{/other_user}","gists_url":"https://api.github.com/users/dantleech/gists{/gist_id}","starred_url":"https://api.github.com/users/dantleech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantleech/subscriptions","organizations_url":"https://api.github.com/users/dantleech/orgs","repos_url":"https://api.github.com/users/dantleech/repos","events_url":"https://api.github.com/users/dantleech/events{/privacy}","received_events_url":"https://api.github.com/users/dantleech/received_events","type":"User","site_admin":false},"body":"This PR allows the restriction of child document types:\r\n\r\n```php\r\n/**\r\n * @PHPCRODM\\Document(restrictChildren={\r\n *   \"Doctrine\\Tests\\Models\\CMS\\CmsArticle\"\r\n * })\r\n */\r\n class ArticleFolder\r\n {\r\n     // ...\r\n }\r\n```\r\n\r\n- By default children are unrestricted (`childRestrictions = null`)\r\n- Children validated on \"insert\".\r\n- Children validated on \"move\".\r\n\r\n### Why?\r\n\r\n- Ensure structural integrity where it matters.\r\n- Determine which types can be added to a document (e.g. in a tree browser).\r\n- Ultimately this could also be part of the node type definition if we ever implementing that.\r\n\r\n### Alternatives\r\n\r\nWe could also implement this as a separate annotation:\r\n\r\n```php\r\n/**\r\n * @Document()\r\n * @RestrictChildren({\r\n *   \"AppBundle\\Document\\Foo\"\r\n *   \"AppBundle\\Document\\Bar\"\r\n * }, restrict=\"include\")\r\n */\r\n```\r\n\r\n Where ``restrict`` is an enum of `none`, `include` and `exclude`.","created_at":"2016-05-30T09:32:35Z","updated_at":"2016-06-02T06:24:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"502b8e406843b17c76024ab63bc10b6eb602538c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/doctrine/phpcr-odm/pulls/706/commits","review_comments_url":"https://api.github.com/repos/doctrine/phpcr-odm/pulls/706/comments","review_comment_url":"https://api.github.com/repos/doctrine/phpcr-odm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/doctrine/phpcr-odm/issues/706/comments","statuses_url":"https://api.github.com/repos/doctrine/phpcr-odm/statuses/1e084bf66f1bbd707c97d37e72a3fbfadce51d8a","head":{"label":"doctrine:children_restriction","ref":"children_restriction","sha":"1e084bf66f1bbd707c97d37e72a3fbfadce51d8a","user":{"login":"doctrine","id":209254,"avatar_url":"https://avatars.githubusercontent.com/u/209254?v=3","gravatar_id":"","url":"https://api.github.com/users/doctrine","html_url":"https://github.com/doctrine","followers_url":"https://api.github.com/users/doctrine/followers","following_url":"https://api.github.com/users/doctrine/following{/other_user}","gists_url":"https://api.github.com/users/doctrine/gists{/gist_id}","starred_url":"https://api.github.com/users/doctrine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doctrine/subscriptions","organizations_url":"https://api.github.com/users/doctrine/orgs","repos_url":"https://api.github.com/users/doctrine/repos","events_url":"https://api.github.com/users/doctrine/events{/privacy}","received_events_url":"https://api.github.com/users/doctrine/received_events","type":"Organization","site_admin":false},"repo":{"id":1352419,"name":"phpcr-odm","full_name":"doctrine/phpcr-odm","owner":{"login":"doctrine","id":209254,"avatar_url":"https://avatars.githubusercontent.com/u/209254?v=3","gravatar_id":"","url":"https://api.github.com/users/doctrine","html_url":"https://github.com/doctrine","followers_url":"https://api.github.com/users/doctrine/followers","following_url":"https://api.github.com/users/doctrine/following{/other_user}","gists_url":"https://api.github.com/users/doctrine/gists{/gist_id}","starred_url":"https://api.github.com/users/doctrine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doctrine/subscriptions","organizations_url":"https://api.github.com/users/doctrine/orgs","repos_url":"https://api.github.com/users/doctrine/repos","events_url":"https://api.github.com/users/doctrine/events{/privacy}","received_events_url":"https://api.github.com/users/doctrine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/doctrine/phpcr-odm","description":"Doctrine2 PHPCR ODM","fork":false,"url":"https://api.github.com/repos/doctrine/phpcr-odm","forks_url":"https://api.github.com/repos/doctrine/phpcr-odm/forks","keys_url":"https://api.github.com/repos/doctrine/phpcr-odm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/doctrine/phpcr-odm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/doctrine/phpcr-odm/teams","hooks_url":"https://api.github.com/repos/doctrine/phpcr-odm/hooks","issue_events_url":"https://api.github.com/repos/doctrine/phpcr-odm/issues/events{/number}","events_url":"https://api.github.com/repos/doctrine/phpcr-odm/events","assignees_url":"https://api.github.com/repos/doctrine/phpcr-odm/assignees{/user}","branches_url":"https://api.github.com/repos/doctrine/phpcr-odm/branches{/branch}","tags_url":"https://api.github.com/repos/doctrine/phpcr-odm/tags","blobs_url":"https://api.github.com/repos/doctrine/phpcr-odm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/doctrine/phpcr-odm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/doctrine/phpcr-odm/git/refs{/sha}","trees_url":"https://api.github.com/repos/doctrine/phpcr-odm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/doctrine/phpcr-odm/statuses/{sha}","languages_url":"https://api.github.com/repos/doctrine/phpcr-odm/languages","stargazers_url":"https://api.github.com/repos/doctrine/phpcr-odm/stargazers","contributors_url":"https://api.github.com/repos/doctrine/phpcr-odm/contributors","subscribers_url":"https://api.github.com/repos/doctrine/phpcr-odm/subscribers","subscription_url":"https://api.github.com/repos/doctrine/phpcr-odm/subscription","commits_url":"https://api.github.com/repos/doctrine/phpcr-odm/commits{/sha}","git_commits_url":"https://api.github.com/repos/doctrine/phpcr-odm/git/commits{/sha}","comments_url":"https://api.github.com/repos/doctrine/phpcr-odm/comments{/number}","issue_comment_url":"https://api.github.com/repos/doctrine/phpcr-odm/issues/comments{/number}","contents_url":"https://api.github.com/repos/doctrine/phpcr-odm/contents/{+path}","compare_url":"https://api.github.com/repos/doctrine/phpcr-odm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/doctrine/phpcr-odm/merges","archive_url":"https://api.github.com/repos/doctrine/phpcr-odm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/doctrine/phpcr-odm/downloads","issues_url":"https://api.github.com/repos/doctrine/phpcr-odm/issues{/number}","pulls_url":"https://api.github.com/repos/doctrine/phpcr-odm/pulls{/number}","milestones_url":"https://api.github.com/repos/doctrine/phpcr-odm/milestones{/number}","notifications_url":"https://api.github.com/repos/doctrine/phpcr-odm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/doctrine/phpcr-odm/labels{/name}","releases_url":"https://api.github.com/repos/doctrine/phpcr-odm/releases{/id}","deployments_url":"https://api.github.com/repos/doctrine/phpcr-odm/deployments","created_at":"2011-02-10T21:22:18Z","updated_at":"2016-05-21T13:53:49Z","pushed_at":"2016-05-30T09:37:07Z","git_url":"git://github.com/doctrine/phpcr-odm.git","ssh_url":"git@github.com:doctrine/phpcr-odm.git","clone_url":"https://github.com/doctrine/phpcr-odm.git","svn_url":"https://github.com/doctrine/phpcr-odm","homepage":"http://www.doctrine-project.org/projects/phpcr-odm.html","size":7043,"stargazers_count":142,"watchers_count":142,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":81,"mirror_url":null,"open_issues_count":76,"forks":81,"open_issues":76,"watchers":142,"default_branch":"master"}},"base":{"label":"doctrine:master","ref":"master","sha":"2e9765e6ab9bbffccdd4f621a56d4c433eafc287","user":{"login":"doctrine","id":209254,"avatar_url":"https://avatars.githubusercontent.com/u/209254?v=3","gravatar_id":"","url":"https://api.github.com/users/doctrine","html_url":"https://github.com/doctrine","followers_url":"https://api.github.com/users/doctrine/followers","following_url":"https://api.github.com/users/doctrine/following{/other_user}","gists_url":"https://api.github.com/users/doctrine/gists{/gist_id}","starred_url":"https://api.github.com/users/doctrine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doctrine/subscriptions","organizations_url":"https://api.github.com/users/doctrine/orgs","repos_url":"https://api.github.com/users/doctrine/repos","events_url":"https://api.github.com/users/doctrine/events{/privacy}","received_events_url":"https://api.github.com/users/doctrine/received_events","type":"Organization","site_admin":false},"repo":{"id":1352419,"name":"phpcr-odm","full_name":"doctrine/phpcr-odm","owner":{"login":"doctrine","id":209254,"avatar_url":"https://avatars.githubusercontent.com/u/209254?v=3","gravatar_id":"","url":"https://api.github.com/users/doctrine","html_url":"https://github.com/doctrine","followers_url":"https://api.github.com/users/doctrine/followers","following_url":"https://api.github.com/users/doctrine/following{/other_user}","gists_url":"https://api.github.com/users/doctrine/gists{/gist_id}","starred_url":"https://api.github.com/users/doctrine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doctrine/subscriptions","organizations_url":"https://api.github.com/users/doctrine/orgs","repos_url":"https://api.github.com/users/doctrine/repos","events_url":"https://api.github.com/users/doctrine/events{/privacy}","received_events_url":"https://api.github.com/users/doctrine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/doctrine/phpcr-odm","description":"Doctrine2 PHPCR ODM","fork":false,"url":"https://api.github.com/repos/doctrine/phpcr-odm","forks_url":"https://api.github.com/repos/doctrine/phpcr-odm/forks","keys_url":"https://api.github.com/repos/doctrine/phpcr-odm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/doctrine/phpcr-odm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/doctrine/phpcr-odm/teams","hooks_url":"https://api.github.com/repos/doctrine/phpcr-odm/hooks","issue_events_url":"https://api.github.com/repos/doctrine/phpcr-odm/issues/events{/number}","events_url":"https://api.github.com/repos/doctrine/phpcr-odm/events","assignees_url":"https://api.github.com/repos/doctrine/phpcr-odm/assignees{/user}","branches_url":"https://api.github.com/repos/doctrine/phpcr-odm/branches{/branch}","tags_url":"https://api.github.com/repos/doctrine/phpcr-odm/tags","blobs_url":"https://api.github.com/repos/doctrine/phpcr-odm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/doctrine/phpcr-odm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/doctrine/phpcr-odm/git/refs{/sha}","trees_url":"https://api.github.com/repos/doctrine/phpcr-odm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/doctrine/phpcr-odm/statuses/{sha}","languages_url":"https://api.github.com/repos/doctrine/phpcr-odm/languages","stargazers_url":"https://api.github.com/repos/doctrine/phpcr-odm/stargazers","contributors_url":"https://api.github.com/repos/doctrine/phpcr-odm/contributors","subscribers_url":"https://api.github.com/repos/doctrine/phpcr-odm/subscribers","subscription_url":"https://api.github.com/repos/doctrine/phpcr-odm/subscription","commits_url":"https://api.github.com/repos/doctrine/phpcr-odm/commits{/sha}","git_commits_url":"https://api.github.com/repos/doctrine/phpcr-odm/git/commits{/sha}","comments_url":"https://api.github.com/repos/doctrine/phpcr-odm/comments{/number}","issue_comment_url":"https://api.github.com/repos/doctrine/phpcr-odm/issues/comments{/number}","contents_url":"https://api.github.com/repos/doctrine/phpcr-odm/contents/{+path}","compare_url":"https://api.github.com/repos/doctrine/phpcr-odm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/doctrine/phpcr-odm/merges","archive_url":"https://api.github.com/repos/doctrine/phpcr-odm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/doctrine/phpcr-odm/downloads","issues_url":"https://api.github.com/repos/doctrine/phpcr-odm/issues{/number}","pulls_url":"https://api.github.com/repos/doctrine/phpcr-odm/pulls{/number}","milestones_url":"https://api.github.com/repos/doctrine/phpcr-odm/milestones{/number}","notifications_url":"https://api.github.com/repos/doctrine/phpcr-odm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/doctrine/phpcr-odm/labels{/name}","releases_url":"https://api.github.com/repos/doctrine/phpcr-odm/releases{/id}","deployments_url":"https://api.github.com/repos/doctrine/phpcr-odm/deployments","created_at":"2011-02-10T21:22:18Z","updated_at":"2016-05-21T13:53:49Z","pushed_at":"2016-05-30T09:37:07Z","git_url":"git://github.com/doctrine/phpcr-odm.git","ssh_url":"git@github.com:doctrine/phpcr-odm.git","clone_url":"https://github.com/doctrine/phpcr-odm.git","svn_url":"https://github.com/doctrine/phpcr-odm","homepage":"http://www.doctrine-project.org/projects/phpcr-odm.html","size":7043,"stargazers_count":142,"watchers_count":142,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":81,"mirror_url":null,"open_issues_count":76,"forks":81,"open_issues":76,"watchers":142,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/doctrine/phpcr-odm/pulls/706"},"html":{"href":"https://github.com/doctrine/phpcr-odm/pull/706"},"issue":{"href":"https://api.github.com/repos/doctrine/phpcr-odm/issues/706"},"comments":{"href":"https://api.github.com/repos/doctrine/phpcr-odm/issues/706/comments"},"review_comments":{"href":"https://api.github.com/repos/doctrine/phpcr-odm/pulls/706/comments"},"review_comment":{"href":"https://api.github.com/repos/doctrine/phpcr-odm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/doctrine/phpcr-odm/pulls/706/commits"},"statuses":{"href":"https://api.github.com/repos/doctrine/phpcr-odm/statuses/1e084bf66f1bbd707c97d37e72a3fbfadce51d8a"}}}}
{"actor":{"display_login":"dbu"}}