Doctrine ORM put null to relation field when write persisting #7588

nkt opened this Issue Apr 7, 2013 · 2 comments


None yet
2 participants

nkt commented Apr 7, 2013

There is my bundle, for more details:
what am I doing wrong?


nkt commented Apr 7, 2013

Problem can be solved if change the code, but it looks like a crutch:

$post = $form->getData()->setAddDate();
$em = $this->getDoctrine()->getManager();
foreach($post->getDogs() as $dog) {

stof commented Apr 7, 2013

@hell0w0rd your Post::addDog method should take care of updating the owning side of the relation (by calling $dog->setPost($this), as Doctrine only considers the owning side (which is documented).

I'm closing this ticket as it is not a bug in Symfony (it is not even related to Symfony itself)

stof closed this Apr 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment