Created
May 12, 2011 17:37
-
-
Save pavelkucera/969030 to your computer and use it in GitHub Desktop.
Doctrine bug?
This file contains 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 | |
$entity = $repository->find($id); | |
$entity->getAssociation()->setProperty('new value'); | |
echo $entity->getAssocation()->getProperty(); // prints 'new value' | |
$em->persist($entity->getAssociation()); // pratically a useless row, the association entity should be already persisted | |
$em->flush(); | |
$em->refresh($entity->getAssociation()); | |
echo $entity->getAssocation()->getProperty(); // prints the old value |
Znám, ale v něm problém není, protože asociace je načtená z db, tedy je už ve výchozím stavu persistovaná (UnitOfWork::isInIdentityMap() vrací true, ozkoušeno).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
znáš cascade? http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-associations.html#transitive-persistence-cascade-operations