mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1184: ORM\Id\AssignedGenerator try to current() on non-array #1489
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 (May 30, 2011).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user slam:
$valuemay also be new, sogetEntityIdentifierreturnsNULLandcurrent(NULL)generates anE_WARNING.@doctrinebot commented on GitHub (Jun 5, 2011):
Comment created by @beberlei:
Optimized error handling
@doctrinebot commented on GitHub (Jun 8, 2011):
Comment created by slam:
Error optimizing is welcome but this does not resolve the issue.
Again, if
$valueis new object, for example anew Entity\Userwith an emptyprotected $id:will ALWAYS throw an exception in the case the Entity is new.
In my projects, i resolved with
I have not unit-tested the solution (i'm sorry) and I think a more accurate investigation is needed.
@doctrinebot commented on GitHub (Jun 11, 2011):
Comment created by @beberlei:
Please read:
http://www.doctrine-project.org/docs/orm/2.0/en/tutorials/composite-primary-keys.html#general-considerations
This is a necessary requirement, that means if you want to create two entities with a composite pk key of the one depending on the other you have to use two flush operations when using MySQL Auto Increment Keys. This will work with PostgreSQL or Oracle Sequences, but not with Auto increment keys.
@doctrinebot commented on GitHub (Jun 11, 2011):
Issue was closed with resolution "Invalid"
@doctrinebot commented on GitHub (Jun 11, 2011):
Comment created by slam:
Ok, roger.
Just one note: you must know that both two entities are STATE_NEW, because if you try to
getEntityState($dependentEntity),UnitOfWork.php:2155will throw a E_RECOVERABLE_ERROR because the $independentEntity could not be converted to a string (because it has no id).