title: Invalid parameter: token 1 is not defined in the query
body: <p>Here is my code to filter pets base on a JSON ajax Query
  I am getting error follwoing image</p>
  
  <p><a href="https://i.stack.imgur.com/S7L3e.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S7L3e.jpg" alt="enter image description here"></a></p>
  
  <pre><code>public function filter($object, $active=true){
  
          $query = $this-&gt;createQueryBuilder('p');
          $query-&gt;innerjoin('TadpetProfessionalBundle:ProPet', 'pp', 'WITH', 'pp.professionalId = p.id');
          $query-&gt;innerjoin('TadpetManagerBundle:Pet', 'ppp', 'WITH', 'ppp.id = pp.petId');
  
          $query-&gt;where('p.isActive = :active')
          -&gt;setParameter('active', $active);
  
          if(!empty($object-&gt;pets)){
              $qString = "";
              for($i=1; $i&lt;=sizeof($object-&gt;pets); $i++){
                  if($i == 1){
                      $qString .= "ppp.name = :petname".$i;
                  }else{
                      $qString .= " OR ppp.name = :petname".$i;
                  }
              }
              $query-&gt;andWhere($qString);
  
              $query-&gt;setParameter('petname'+1,$object-&gt;pets[0]);
              $query-&gt;setParameter('petname'+2,$object-&gt;pets[1]);
              $query-&gt;setParameter('petname'+3,$object-&gt;pets[2]);
          }
          return $query-&gt;getQuery()-&gt;getResult();
  </code></pre>
  
  <p>}</p>
  
  <p>Help me please</p>