Hi João, Please see https://gist.github.com/Ocramius/3121916
Also see http://www.doctrine-project.org/jira/browse/DDC-2585 and http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/unitofwork-associations.html#association-updates-owning-side-and-inverse-side Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 16 February 2015 at 15:49, João Carlos Santa Ana < [email protected]> wrote: > Hello I really need to understand this. > In my projects I have found the following problem. > > $user = new User\Entity\User(); > $this->em->persist($user); > $this->em->flush(); > > $address = new Address\Entity\Address(); > $user->setAddress($address); //ArrayCollection > > $this->em->persist($user); > $this->em->flush(); > > If soon after: > var_dump($user->getAddress()->count()); // 0 > > but: > > refresh the page: > Call for a new function; > var_dump($user->getAddress()->count()); // 1 > > I need to know if I have to work it out > > Thanks. > > > > > -- > 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 http://groups.google.com/group/doctrine-user. > For more options, visit https://groups.google.com/d/optout. > -- 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 http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
