mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Initialize proxies with all their collections already being PersistentCollection
#5710
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Ocramius on GitHub (Sep 23, 2017).
Originally assigned to: @Ocramius on GitHub.
Starting with #6719, proxies can be partially loaded by just deciding which fields are to be lazy-loaded and which are not: this allows us to initialize them with empty
PersistentCollectioninstances upfront.Take this example:
The logic above triggers two
SELECTqueries in ORM 2.x. In ORM 3.x, we could make it perform just theSELECTquery that initializes theBlogPost#$commentscollection if the property is always replaced with aDoctrine\ORM\PersistentCollection