title: How to do a LIKE database query in Symfony2
body: <p>This should be simple but I can't find a working example.  Here's a controller method that throws the error "Invalid parameter number: number of bound variables does not match number of tokens".  I'm posting the "searchterm" variable successfully but can't get the query to work.  What is missing?  Thanks!</p>
  
  <pre><code> public function searchAction()
  {
      $request = $this-&gt;getRequest();
  
      $searchterm = $request-&gt;get('searchterm');
  
      $em = $this-&gt;getDoctrine()-&gt;getEntityManager();
  
      $query = $em-&gt;createQuery("SELECT n FROM AcmeNodeBundle:Node n WHERE n.title LIKE '% :searchterm %'")
               -&gt;setParameter('searchterm', $searchterm);
  
      $entities = $query-&gt;getResult();
  
      return array('entities' =&gt; $entities);
  
  }
  </code></pre>