8000 Fix orm example by hidenorigoto · Pull Request #58 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Fix orm example #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
remove old example code and replace them to new ones
  • Loading branch information
hidenorigoto committed Dec 3, 2010
commit 0d143bd04ba920d6a3cf7ffa9d26d6817dd6fb64
5 changes: 3 additions & 2 deletions guides/doctrine/orm/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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();

// ...
Expand All @@ -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();

Expand Down
0