php - How does Doctrine 2 retrieve entities without calling the entity's constructor? -
does know how works?
this works unserializing objects. unserializing in php prevent constructor called serialized object has been constructed.
create object without calling it's constructor in php:
$classname = 'stdclass'; # set classname here $serialized = sprintf('o:%d:"%s":0:{}', strlen($classname), $classname); $object = unserialize($serialized);
for more details please see article: doctrine 2: give me constructor back
Comments
Post a Comment