public function agencyHome(EntityManagerInterface $em)
{
$repository = $em->getRepository(Ships::class);
// $ships = $repository->findByOwner($own);
$ships = $repository->findAll();
return $this->render('agency/index.html.twig', [
'ships' => $ships,
]);
}
on the code above i need to pass current logged in user to a repository, so i can find all related "ships" i tried with $u = $this->getUser()->getId(); with no succes :(
thank you in advance :)