$queryBulder = $repo->createQueryBuilder('a');
$items = $queryBulder->getQuery()->getArrayResult();
public function someAction(
\Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository $repo,
\Symfony\Component\HttpFoundation\Request $request
): \Symfony\Component\HttpFoundation\Response
{
$queryBulder = $repo->createQueryBuilder('a');
$em = $queryBulder->getEntityManager();
$MetaData = $em->getClassMetadata($repo->getClassName());
$associations = $MetaData->getAssociationMappings();
}