mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-428: "Not fully loaded proxy can not be serialized." #534
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, 2010).
Jira issue originally created by user jakajancar:
I'm trying to serialize an entity and am getting the above error.
I don't get it, why doesn't it just fully load it then?
@doctrinebot commented on GitHub (Mar 16, 2010):
Comment created by romanb:
Because that would result in recursively pulling out huge parts of your database and serialize a huge object graph. Where should the automatic loading end? Doctrine cant know. You should "cut" the object graph to your needs before serializing it.
Serializing objects in PHP is btw. pretty flawed in many ways and it gets worse with entities. Make sure you also read this: http://www.doctrine-project.org/documentation/manual/2_0/en/architecture#entities:serializing-entities.
Summary: **sleep is flawed and Serializable is even more flawed :) If you still want to serialize entities, cut the associations (nulling out) that you dont want serialized and explicitly (lazy) load the associations you do want serialized.
ps. The user or dev mailing list is the preferred way to ask questions.
@doctrinebot commented on GitHub (Mar 16, 2010):
Issue was closed with resolution "Can't Fix"
@doctrinebot commented on GitHub (Aug 5, 2010):
Comment created by @beberlei:
Our opinion on this changed and serializing is now possible after this ticket implementation, http://www.doctrine-project.org/jira/browse/DDC-518