KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to be able to retrieve the existing version of an entity so I can compare it with the latest version. E.g. Editing a file, I want to know if the value has changed since being in the DB. $entityManager = $this->get('doctrine')->getEntityManager(); $postManager = $this->get('synth_knowledge_share.manager'); $repository = $entityManager->getRepository('KnowledgeShareBundle:Post'); $post = $repository->findOneById(1); var_dump($post->getTitle()); // This would output "My Title" $post->setTitle("Unpersisted new title"); $existingPost = $repository->findOneById(1); // Retrieve the old entity var_dump($existingPost->getTitle()); // This would output "Unpersisted new title" instead of the expected "My Title" Does anyone know how I can get around this caching?
Tags (comma-separated)
Save Edits
Cancel