mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-1712: proxy calss constructor do not call it's parent constructor #2157
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 @doctrinebot on GitHub (Mar 16, 2012).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user mdrolet:
I've create a OneToMany relation in my entity and into the entity constructor I define my relation property to be an ArrayCollection.
When I load an existing entity that have no entries from it's relation, I'm waiting to receive an empty ArrayCollection but I got null into the proxy entity object cause my parentEntity __consctruct is never called from the proxyEntity __construct class.
ORM/Proxy/ProxyFactory.php line 356. <-- this is where the proxy class **construct method is generated.
I'm following the Best Practice manuel :-)
http://docs.doctrine-project.org/projects/doctrine-orm/en/2.0.x/reference/best-practices.html
25.8. Initialize collections in the constructor
@doctrinebot commented on GitHub (Mar 16, 2012):
Comment created by @beberlei:
Proxies are only created for classes coming from persistence. Classes reconstructed from persistence don't call the constructor but only **wakeup and then populate all the collections from persistence.
@doctrinebot commented on GitHub (Mar 16, 2012):
Issue was closed with resolution "Invalid"