Symfony models with foreign keys
- by Daniel Hertz
So I have 2 models. Users and Groups. Each group has a user as the creator and a group has many users. The FK of these tables are set up correctly, but I was wondering if there was an easier way to get all related FK objects from other objects. For example, with a group object, is there a built in method to get the user object of the creator? Or for a user, is there a built in method to get all group object that he belongs to? I couldn't find out how to do this with the documentation on the symfony page. From what I see I feel like I need to create methods and use doctrine to access the appropriate tables using the current objects id and so on.
Thanks!