I haven't used that syntax before, but the Symfony docs have examples of using the query builder, and they show something like this:
$query = $repository->createQueryBuilder('c')
->where('c.categoryParentid = :pcategory')
->setParameter('pcategory', $pcategory->getcategoryId())
->orderBy('c.categoryId', 'ASC')
->getQuery();