Skip to content

Commit d0c2610

Browse files
hidenorigotofabpot
authored andcommitted
remove old example code and replace them to new ones
1 parent bd1c12b commit d0c2610

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

guides/doctrine/orm/overview.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,9 @@ Eventually, use your entity and manage its persistent state with Doctrine::
164164
public function editAction($id)
165165
{
166166
$em = $this->get('doctrine.orm.entity_manager');
167-
$user = $em->createQuery('SELECT u FROM HelloBundle:User WHERE id = ?', $id);
167+
$user = $em->find('HelloBundle:User', $id);
168168
$user->setBody('new body');
169+
$em->persist($user);
169170
$em->flush();
170171

171172
// ...
@@ -174,7 +175,7 @@ Eventually, use your entity and manage its persistent state with Doctrine::
174175
public function deleteAction($id)
175176
{
176177
$em = $this->get('doctrine.orm.entity_manager');
177-
$user = $em->createQuery('SELECT e FROM HelloBundle:User WHERE id = ?', $id);
178+
$user = $em->find('HelloBundle:User', $id);
178179
$em->remove($user);
179180
$em->flush();
180181

0 commit comments

Comments
 (0)