From 0d143bd04ba920d6a3cf7ffa9d26d6817dd6fb64 Mon Sep 17 00:00:00 2001 From: hidenorigoto Date: Fri, 3 Dec 2010 20:24:52 +0900 Subject: [PATCH] remove old example code and replace them to new ones --- guides/doctrine/orm/overview.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/guides/doctrine/orm/overview.rst b/guides/doctrine/orm/overview.rst index 8c49e36f5ef..6113afc7770 100644 --- a/guides/doctrine/orm/overview.rst +++ b/guides/doctrine/orm/overview.rst @@ -164,8 +164,9 @@ Eventually, use your entity and manage its persistent state with Doctrine:: public function editAction($id) { $em = $this->get('doctrine.orm.entity_manager'); - $user = $em->createQuery('SELECT u FROM HelloBundle:User WHERE id = ?', $id); + $user = $em->find('HelloBundle:User', $id); $user->setBody('new body'); + $em->persist($user); $em->flush(); // ... @@ -174,7 +175,7 @@ Eventually, use your entity and manage its persistent state with Doctrine:: public function deleteAction($id) { $em = $this->get('doctrine.orm.entity_manager'); - $user = $em->createQuery('SELECT e FROM HelloBundle:User WHERE id = ?', $id); + $user = $em->find('HelloBundle:User', $id); $em->remove($user); $em->flush();