{"action":"opened","number":6902,"pull_request":{"url":"https://api.github.com/repos/doctrine/doctrine2/pulls/6902","id":159000145,"html_url":"https://github.com/doctrine/doctrine2/pull/6902","diff_url":"https://github.com/doctrine/doctrine2/pull/6902.diff","patch_url":"https://github.com/doctrine/doctrine2/pull/6902.patch","issue_url":"https://api.github.com/repos/doctrine/doctrine2/issues/6902","number":6902,"state":"open","locked":false,"title":"Documentation about getters/setters to DTOs and Value Objects","user":{"login":"Pierstoval","id":3369266,"avatar_url":"https://avatars0.githubusercontent.com/u/3369266?v=4","gravatar_id":"","url":"https://api.github.com/users/Pierstoval","html_url":"https://github.com/Pierstoval","followers_url":"https://api.github.com/users/Pierstoval/followers","following_url":"https://api.github.com/users/Pierstoval/following{/other_user}","gists_url":"https://api.github.com/users/Pierstoval/gists{/gist_id}","starred_url":"https://api.github.com/users/Pierstoval/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pierstoval/subscriptions","organizations_url":"https://api.github.com/users/Pierstoval/orgs","repos_url":"https://api.github.com/users/Pierstoval/repos","events_url":"https://api.github.com/users/Pierstoval/events{/privacy}","received_events_url":"https://api.github.com/users/Pierstoval/received_events","type":"User","site_admin":false},"body":"I recently [tweeted](https://twitter.com/Pierstoval/status/942768021038186497) about this, but the original questioning comes from @javiereguiluz:\r\n\r\nThe \"Getting started\" guide refers to getters and setters as the base of an entity's behavior, but the Doctrine core team and other experts certainly prefer mapping rich accessors and mutators. @Ocramius also gives this advice in [his \"Doctrine beset practices\" conference](https://www.youtube.com/watch?v=rzGeNYC3oz0) ([slides here](https://ocramius.github.io/doctrine-best-practices/)).\r\n\r\nThis PR is not a _final_ proposal, but more a starter about a change to the documentation to suggest using a rich model for our domain instead of relying only on getters and setters.\r\n\r\nI thought it would still be nice to bring the getters and setters and then talk about DTOs and rich model, to keep consistency with the 95% (arbitrary number) entities created by developers these days, especially the ones using Symfony (and mostly because the Symfony Form component uses getters and setters **a lot**, and most docs propose to inject them in our forms rather than relying on a DTO).\r\n\r\nWDYT about this?","created_at":"2017-12-18T19:42:04Z","updated_at":"2017-12-18T19:42:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/doctrine/doctrine2/pulls/6902/commits","review_comments_url":"https://api.github.com/repos/doctrine/doctrine2/pulls/6902/comments","review_comment_url":"https://api.github.com/repos/doctrine/doctrine2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/doctrine/doctrine2/issues/6902/comments","statuses_url":"https://api.github.com/repos/doctrine/doctrine2/statuses/3660b163ff7e07bf91cba02ab77fbf95686cf4c6","head":{"label":"Pierstoval:dto-and-vo","ref":"dto-and-vo","sha":"3660b163ff7e07bf91cba02ab77fbf95686cf4c6","user":{"login":"Pierstoval","id":3369266,"avatar_url":"https://avatars0.githubusercontent.com/u/3369266?v=4","gravatar_id":"","url":"https://api.github.com/users/Pierstoval","html_url":"https://github.com/Pierstoval","followers_url":"https://api.github.com/users/Pierstoval/followers","following_url":"https://api.github.com/users/Pierstoval/following{/other_user}","gists_url":"https://api.github.com/users/Pierstoval/gists{/gist_id}","starred_url":"https://api.github.com/users/Pierstoval/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pierstoval/subscriptions","organizations_url":"https://api.github.com/users/Pierstoval/orgs","repos_url":"https://api.github.com/users/Pierstoval/repos","events_url":"https://api.github.com/users/Pierstoval/events{/privacy}","received_events_url":"https://api.github.com/users/Pierstoval/received_events","type":"User","site_admin":false},"repo":{"id":114672294,"name":"doctrine2","full_name":"Pierstoval/doctrine2","owner":{"login":"Pierstoval","id":3369266,"avatar_url":"https://avatars0.githubusercontent.com/u/3369266?v=4","gravatar_id":"","url":"https://api.github.com/users/Pierstoval","html_url":"https://github.com/Pierstoval","followers_url":"https://api.github.com/users/Pierstoval/followers","following_url":"https://api.github.com/users/Pierstoval/following{/other_user}","gists_url":"https://api.github.com/users/Pierstoval/gists{/gist_id}","starred_url":"https://api.github.com/users/Pierstoval/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pierstoval/subscriptions","organizations_url":"https://api.github.com/users/Pierstoval/orgs","repos_url":"https://api.github.com/users/Pierstoval/repos","events_url":"https://api.github.com/users/Pierstoval/events{/privacy}","received_events_url":"https://api.github.com/users/Pierstoval/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Pierstoval/doctrine2","description":"Doctrine 2 Object Relational Mapper (ORM)","fork":true,"url":"https://api.github.com/repos/Pierstoval/doctrine2","forks_url":"https://api.github.com/repos/Pierstoval/doctrine2/forks","keys_url":"https://api.github.com/repos/Pierstoval/doctrine2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Pierstoval/doctrine2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Pierstoval/doctrine2/teams","hooks_url":"https://api.github.com/repos/Pierstoval/doctrine2/hooks","issue_events_url":"https://api.github.com/repos/Pierstoval/doctrine2/issues/events{/number}","events_url":"https://api.github.com/repos/Pierstoval/doctrine2/events","assignees_url":"https://api.github.com/repos/Pierstoval/doctrine2/assignees{/user}","branches_url":"https://api.github.com/repos/Pierstoval/doctrine2/branches{/branch}","tags_url":"https://api.github.com/repos/Pierstoval/doctrine2/tags","blobs_url":"https://api.github.com/repos/Pierstoval/doctrine2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Pierstoval/doctrine2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Pierstoval/doctrine2/git/refs{/sha}","trees_url":"https://api.github.com/repos/Pierstoval/doctrine2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Pierstoval/doctrine2/statuses/{sha}","languages_url":"https://api.github.com/repos/Pierstoval/doctrine2/languages","stargazers_url":"https://api.github.com/repos/Pierstoval/doctrine2/stargazers","contributors_url":"https://api.github.com/repos/Pierstoval/doctrine2/contributors","subscribers_url":"https://api.github.com/repos/Pierstoval/doctrine2/subscribers","subscription_url":"https://api.github.com/repos/Pierstoval/doctrine2/subscription","commits_url":"https://api.github.com/repos/Pierstoval/doctrine2/commits{/sha}","git_commits_url":"https://api.github.com/repos/Pierstoval/doctrine2/git/commits{/sha}","comments_url":"https://api.github.com/repos/Pierstoval/doctrine2/comments{/number}","issue_comment_url":"https://api.github.com/repos/Pierstoval/doctrine2/issues/comments{/number}","contents_url":"https://api.github.com/repos/Pierstoval/doctrine2/contents/{+path}","compare_url":"https://api.github.com/repos/Pierstoval/doctrine2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Pierstoval/doctrine2/merges","archive_url":"https://api.github.com/repos/Pierstoval/doctrine2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Pierstoval/doctrine2/downloads","issues_url":"https://api.github.com/repos/Pierstoval/doctrine2/issues{/number}","pulls_url":"https://api.github.com/repos/Pierstoval/doctrine2/pulls{/number}","milestones_url":"https://api.github.com/repos/Pierstoval/doctrine2/milestones{/number}","notifications_url":"https://api.github.com/repos/Pierstoval/doctrine2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Pierstoval/doctrine2/labels{/name}","releases_url":"https://api.github.com/repos/Pierstoval/doctrine2/releases{/id}","deployments_url":"https://api.github.com/repos/Pierstoval/doctrine2/deployments","created_at":"2017-12-18T18:03:02Z","updated_at":"2017-12-18T18:03:08Z","pushed_at":"2017-12-18T19:35:55Z","git_url":"git://github.com/Pierstoval/doctrine2.git","ssh_url":"git@github.com:Pierstoval/doctrine2.git","clone_url":"https://github.com/Pierstoval/doctrine2.git","svn_url":"https://github.com/Pierstoval/doctrine2","homepage":"http://www.doctrine-project.org","size":33654,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"doctrine:master","ref":"master","sha":"e1825e37ef551ac36d7a0250cfa2678f8f4d98a0","user":{"login":"doctrine","id":209254,"avatar_url":"https://avatars3.githubusercontent.com/u/209254?v=4","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":597887,"name":"doctrine2","full_name":"doctrine/doctrine2","owner":{"login":"doctrine","id":209254,"avatar_url":"https://avatars3.githubusercontent.com/u/209254?v=4","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/doctrine2","description":"Doctrine 2 Object Relational Mapper (ORM)","fork":false,"url":"https://api.github.com/repos/doctrine/doctrine2","forks_url":"https://api.github.com/repos/doctrine/doctrine2/forks","keys_url":"https://api.github.com/repos/doctrine/doctrine2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/doctrine/doctrine2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/doctrine/doctrine2/teams","hooks_url":"https://api.github.com/repos/doctrine/doctrine2/hooks","issue_events_url":"https://api.github.com/repos/doctrine/doctrine2/issues/events{/number}","events_url":"https://api.github.com/repos/doctrine/doctrine2/events","assignees_url":"https://api.github.com/repos/doctrine/doctrine2/assignees{/user}","branches_url":"https://api.github.com/repos/doctrine/doctrine2/branches{/branch}","tags_url":"https://api.github.com/repos/doctrine/doctrine2/tags","blobs_url":"https://api.github.com/repos/doctrine/doctrine2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/doctrine/doctrine2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/doctrine/doctrine2/git/refs{/sha}","trees_url":"https://api.github.com/repos/doctrine/doctrine2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/doctrine/doctrine2/statuses/{sha}","languages_url":"https://api.github.com/repos/doctrine/doctrine2/languages","stargazers_url":"https://api.github.com/repos/doctrine/doctrine2/stargazers","contributors_url":"https://api.github.com/repos/doctrine/doctrine2/contributors","subscribers_url":"https://api.github.com/repos/doctrine/doctrine2/subscribers","subscription_url":"https://api.github.com/repos/doctrine/doctrine2/subscription","commits_url":"https://api.github.com/repos/doctrine/doctrine2/commits{/sha}","git_commits_url":"https://api.github.com/repos/doctrine/doctrine2/git/commits{/sha}","comments_url":"https://api.github.com/repos/doctrine/doctrine2/comments{/number}","issue_comment_url":"https://api.github.com/repos/doctrine/doctrine2/issues/comments{/number}","contents_url":"https://api.github.com/repos/doctrine/doctrine2/contents/{+path}","compare_url":"https://api.github.com/repos/doctrine/doctrine2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/doctrine/doctrine2/merges","archive_url":"https://api.github.com/repos/doctrine/doctrine2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/doctrine/doctrine2/downloads","issues_url":"https://api.github.com/repos/doctrine/doctrine2/issues{/number}","pulls_url":"https://api.github.com/repos/doctrine/doctrine2/pulls{/number}","milestones_url":"https://api.github.com/repos/doctrine/doctrine2/milestones{/number}","notifications_url":"https://api.github.com/repos/doctrine/doctrine2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/doctrine/doctrine2/labels{/name}","releases_url":"https://api.github.com/repos/doctrine/doctrine2/releases{/id}","deployments_url":"https://api.github.com/repos/doctrine/doctrine2/deployments","created_at":"2010-04-06T21:42:59Z","updated_at":"2017-12-18T09:23:29Z","pushed_at":"2017-12-18T19:40:50Z","git_url":"git://github.com/doctrine/doctrine2.git","ssh_url":"git@github.com:doctrine/doctrine2.git","clone_url":"https://github.com/doctrine/doctrine2.git","svn_url":"https://github.com/doctrine/doctrine2","homepage":"http://www.doctrine-project.org","size":32635,"stargazers_count":3878,"watchers_count":3878,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1867,"mirror_url":null,"archived":false,"open_issues_count":1163,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1867,"open_issues":1163,"watchers":3878,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/doctrine/doctrine2/pulls/6902"},"html":{"href":"https://github.com/doctrine/doctrine2/pull/6902"},"issue":{"href":"https://api.github.com/repos/doctrine/doctrine2/issues/6902"},"comments":{"href":"https://api.github.com/repos/doctrine/doctrine2/issues/6902/comments"},"review_comments":{"href":"https://api.github.com/repos/doctrine/doctrine2/pulls/6902/comments"},"review_comment":{"href":"https://api.github.com/repos/doctrine/doctrine2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/doctrine/doctrine2/pulls/6902/commits"},"statuses":{"href":"https://api.github.com/repos/doctrine/doctrine2/statuses/3660b163ff7e07bf91cba02ab77fbf95686cf4c6"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":152,"deletions":31,"changed_files":1}}
{"actor":{"display_login":"Pierstoval"}}