Details
Description
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.
__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.