mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-842: spl_object_hash tries to get hash from array - fails #1041
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 (Oct 19, 2010).
Jira issue originally created by user sebastian.hoitz:
I have a model which looks like this:
When I try to persist my object to the database, Doctrine causes this error:
I assume that this might happen, because of the Class B holding one Class C, and Class A also holding some Class C instances.
Those are, in some cases, the same. So when a new Class B is added, together with a new Class C, this new Class C is also added to Class A.
And somehow internally the already persisted Class C (Class B is getting persisted first) transforms the Class C instance into an array, and Doctrine can't save it anymore.
This is my guess of what happens. When I skip adding all the Class C instances to Class A, I don't get this error.