find user by username from multiple providers [symfony2]
问题 I need to find a user object in symfony2 based on the username or emailadres. This is not for loggin in, but for other actions on a user. I can simply request the (Doctrine2) repository and call the method loadByUsername from the UserProviderInterface that is on my repository-class. But the code that needs to do this will be used in multiple projects and I need it to be a bit more generic. The user class/table might be different or the users might come from a completely different type of