mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-1022: Wakeup behavior difference between proxy and eager-loaded instance #1275
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 (Feb 9, 2011).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user k-fish:
When an object is reconstituted from the persistent storage the unserialize trick is used. That means
**wakeup()is called, which is useful to do further initialization as needed.If the object is lazy loaded a proxy is generated. That proxy is generated with
newand thus no*_wakeup()is called. When the proxy is eventually initialized still no call to_*wakeup()is done, thus initialization code that is "usually" executed is not called when an object is lazy-loaded.That is a semantical error.
@doctrinebot commented on GitHub (Feb 26, 2011):
Comment created by @beberlei:
**wakeup() shouldn't be used as per definition of an entity, http://www.doctrine-project.org/docs/orm/2.0/en/cookbook/implementing-wakeup-or-clone.html
For post initialization "postLoad()" should be used.
@doctrinebot commented on GitHub (Feb 26, 2011):
Comment created by k-fish:
@doctrinebot commented on GitHub (Jul 9, 2011):
Comment created by @beberlei:
I changed my mind, this is valid
@doctrinebot commented on GitHub (Jul 9, 2011):
Comment created by @beberlei:
Fixed in 2.0.7, 2.1.1 and in master
@doctrinebot commented on GitHub (Jul 9, 2011):
Issue was closed with resolution "Fixed"