Created
December 7, 2012 14:03
-
-
Save andriesss/4233452 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$user = new User(); | |
$user->addComment(new Comment('foo')); | |
$user->addComment(new Comment('baz')); | |
$user->addComment(new Comment('bar')); | |
$em->persist($user); // i only want the "user" object to be persisted, not the whole object graph | |
$em->flush(); |
I think you've just answered my question. In "the real code", the entity has identity through a foreign entity.
I have the same problem, did you find a solution to the problem?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
but comment doesnt have identity through a foreign entity, it has its own ID field with auto generated value. You must show the wrong code, you cannot get that error message.