you can try this
$address->setStreet($em->getReference("\Address", $address->getId()) );
On Tuesday, July 20, 2010 at 3:35:18 PM UTC+8, jiewmeng wrote:
>
> i am using the doctrine sandbox
>
> i am wondering my this fails
>
> $user = new User;
> $user->setName("User 1");
> $address = new Address;
> $address->setStreet("Address 1");
> $user->setAddress($address);
> $em->persist($user);
> $em->flush();
>
> i am getting
>
> A new entity was found through a relationship that was not configured
> to cascade persist operations: Entities
> \Address@0000000002f128f1000000002da3ffcd. Explicitly persist the new
> entity or configure cascading persist operations on the relationship
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.