Symfony3 The identifier id is missing for a query of AppBundle\Entity\
<p>I am new to symfony and I am trying to pass a object from a list to a new page using: </p>

<p><code>&lt;a href="{{ path('fooUpdate', { 'id': item.id }) }}"&gt;Update&lt;/a&gt;</code></p>

<p>The list <code>({% for item in list %})</code> of Foo objects is fine, the objects are fully loaded from the database, but the link does not work because of this Doctrine error:</p>

<p><code>The identifier id is missing for a query of AppBundle\Entity\Foo</code></p>

<p>Here is the Foo class:</p>

<pre><code>namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/** 
 * @ORM\Entity
 * @ORM\Table(name="foo") 
 */
class Foo {

/** 
 * @ORM\Id 
 * @ORM\Column(type="integer") 
 * @ORM\GeneratedValue
 */
private $id;

/** 
 * @ORM\Column(type="string")    
 */
private $description;

//getters and setters
</code></pre>

<p>And here is the controller method:</p>

<pre><code>/**
 * @Route("/foo/fooUpdate/", name="fooUpdate")
 */
public function updateAction($id, Request $request) {
    $foo = $this-&gt;getDoctrine()-&gt;getRepository('AppBundle:Foo')-&gt;find($id);
    return $this-&gt;render('/foo/fooUpdate.html.twig', array(
            'foo' =&gt; $foo
    ));
}
</code></pre>

<p>The link itself looks like it is working, because the URL of the error is:</p>

<pre><code>http://127.0.0.1:8000/foo/fooUpdate/?id=1
</code></pre>

<p>So what am I missing?</p>

<p>Also, is there any way of doing this using POST, so the id will not appear in the URL?</p>