http://docs.symfony-reloaded.org/guides/doctrine/orm/overview.html seems to 
be untested or perhaps based on something that worked long ago?

$user = $em->createQuery('SELECT u FROM HelloBundle:User WHERE id = ?', $id);
        $user->setBody('new body');

This will not work, there is no execution of the query. Also the ?, $id 
syntax doesn't seem to be supported in Doctrine 2 (I'm less certain of that 
part). And the class-finding syntax seems wrong, that should be a \ not a :, 
right?

I started referring to the Doctrine 2 tutorial instead, and wound up with:

$page = $em->createQuery('SELECT p FROM 
Application\SillyCMSBundle\Entity\Page p WHERE p.slug = 
?1')->setParameter(1, $slug)->getSingleResult();

That gave me a valid object.

The original code would be easier to write with find() although that might 
be less instructional.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to