I\'m using FOSUserBundle to authenticate my users.
I\'m trying to get the user object inside the Controller to register a trip where I should add the user object to
Solution:
$userManager = $this->container->get('fos_user.user_manager'); $user = $userManager->findUserByUsername($this->container->get('security.context') ->getToken() ->getUser())