createQueryBuilder('w') ->andWhere('w.byUser = :val') ->setParameter('val', $value) ->orderBy('w.id', 'ASC') ->setMaxResults(10) ->getQuery() ->getResult() ; } /* public function findOneBySomeField($value): ?Wish { return $this->createQueryBuilder('w') ->andWhere('w.exampleField = :val') ->setParameter('val', $value) ->getQuery() ->getOneOrNullResult() ; } */ }