title: Doctrine select where equal to variable
body: <p>This is what I want to do:</p>
  
  <pre><code>$query = $repository-&gt;createQueryBuilder('c')
       -&gt;where('c.categoryParentid = ?', $pcategory-&gt;getcategoryId())
       -&gt;orderBy('c.categoryId', 'ASC')
       -&gt;getQuery();
  
  $childcategories = $query-&gt;getResult();
  </code></pre>
  
  <p>The <code>$pcategory-&gt;getcategoryId()</code> is an integer. The where, is this correct?
  I get this error:</p>
  
  <pre><code>ContextErrorException: Warning: get_class() expects parameter 1 to be object, integer given in /Applications/mampstack-5.4.20-0/apache2/htdocs/reuzze/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Base.php line 92
  </code></pre>