Although I use Symfony 2.1 with FOSUserBundle and everything works fine, I donβt know how I can solve the problem.
Basically, I would like to know if there is a way to find (load or receive) a user from the database, taking into account the relationship to another object.
In this situation:
I made sure that users can also log into my site through a social network (Google, Facebook, LinkedIn, etc.). In addition, I ask them to use offline access, so I can access their social accounts at any time.
Since each user can have as many connections as they need (or maybe not because they are options), I decided not to save this information in the user table. I created an abstract object called "SocialConnection", which is expanded by real ones (Google, Facebook, ect). In this entity, I store the user information that I receive when a user logs on to my site through these networks (user_id, social_id, access_token, etc.), so in my User class I mapped a collection of abstract "SocialEngine" that allows me so that all networks are united.
To be able to add other networks, such as Twitter, Yahoo, etc. in the future, I think it should be so.
So, now the problem is that when a user registers on my site through any of these social networks, I need to download it from the database, knowing his social identifier, but I donβt know how to do it.
I saw that the $ this-> findUserBy UserManager method finds the user in relation to the property, but I think it is not.
What should I do to find a good solution?
Thanks in advance.
Regards, Izzy