createQueryBuilder('t') ->innerJoin('t.sectionIdsection','s') ->Where('s.idsection = :val') ->setParameter('val', $idsection) ->orderBy('t.idmessage', 'DESC') //->setMaxResults(10) ->getQuery() ->getResult(); } }