Skip to content

Instantly share code, notes, and snippets.

@pavelkucera
Created May 12, 2011 17:37
Show Gist options
  • Save pavelkucera/969030 to your computer and use it in GitHub Desktop.
Save pavelkucera/969030 to your computer and use it in GitHub Desktop.
Doctrine bug?
<?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
@pavelkucera
Copy link
Author

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