ZF has a very nice feature which is called findManyToManyRowset which returns you directly a collection of objects from a MN connection. The whole purpose of MN is to get the information from the other table, not from the connection table.
We have this schema:
- users
- id
- name
- groups
- id
- name
- user_has_groups
- user_id
- group_id
I want to create a user function that will return directly a collection of group objects and not a collection of user_has_groups objects.
$user->UserHasGroups ;// returns a collection of user_has_groups
$user->Groups; // returns Doctrine_Record_UnknownPropertyException
Is there a way to do this directly?