{"action":"opened","issue":{"url":"https://api.github.com/repos/doctrine/doctrine2/issues/6808","repository_url":"https://api.github.com/repos/doctrine/doctrine2","labels_url":"https://api.github.com/repos/doctrine/doctrine2/issues/6808/labels{/name}","comments_url":"https://api.github.com/repos/doctrine/doctrine2/issues/6808/comments","events_url":"https://api.github.com/repos/doctrine/doctrine2/issues/6808/events","html_url":"https://github.com/doctrine/doctrine2/issues/6808","id":270700359,"number":6808,"title":"Partial hydration of toMany associations without results does not initialize PersistentCollection","user":{"login":"egonolieux","id":4681670,"avatar_url":"https://avatars2.githubusercontent.com/u/4681670?v=4","gravatar_id":"","url":"https://api.github.com/users/egonolieux","html_url":"https://github.com/egonolieux","followers_url":"https://api.github.com/users/egonolieux/followers","following_url":"https://api.github.com/users/egonolieux/following{/other_user}","gists_url":"https://api.github.com/users/egonolieux/gists{/gist_id}","starred_url":"https://api.github.com/users/egonolieux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egonolieux/subscriptions","organizations_url":"https://api.github.com/users/egonolieux/orgs","repos_url":"https://api.github.com/users/egonolieux/repos","events_url":"https://api.github.com/users/egonolieux/events{/privacy}","received_events_url":"https://api.github.com/users/egonolieux/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-02T15:37:27Z","updated_at":"2017-11-02T15:37:27Z","closed_at":null,"author_association":"NONE","body":"To avoid performance issues using fetch joins, I hydrate some of my toMany associations using partial hydration:\r\n\r\n`SELECT someEntity, PARTIAL mainEntity.{id} FROM \\Entity\\MainEntity mainEntity ...`\r\n\r\nIf the query returns no results, the Doctrine PersistentCollection object remains uninitialized causing lazy loading to be triggered if the collection is accessed.\r\n\r\nIs this intended behavior? To resolve this at the moment, I am forcing the PersistenCollection into an initialized state using `setInitialized`."}}
{"actor":{"display_login":"egonolieux"}}