The question is old, but still very relevant, I think. The answer helped me in the right path (FOSUserBundle 2.0 with Symfony 3.3) - if someone is still looking, here are more details
https://symfony.com/doc/master/bundles/FOSUserBundle/user_manager.html
This part was key for me:
You can replace the default implementation of the user manager by
defining a service implementing
FOS\UserBundle\Model\UserManagerInterface
and setting its id in the
configuration. The id of the default implementation is
fos_user.user_manager.default
fos_user:
# ...
service:
user_manager: custom_user_manager_id
Your custom implementation can extend FOS\UserBundle\Model\UserManager
to reuse the common logic.
And in my case, I just copied the whole of FOS\UserBundle\Doctrine\UserManager
(which extends FOS\UserBundle\Model\UserManager
) into my AppBundle\Services
as my starting point.
I also had to copy the injections from here: vendor/friendsofsymfony/user-bundle/Resources/config/doctrine.xml