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 new and 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.
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.
Comment created by k-fish:
I changed my mind, this is valid
Fixed in 2.0.7, 2.1.1 and in master
Issue was closed with resolution "Fixed"