this has been asked many times before. We should probably add it to a
FAQ.
> Hi everybody,
> I was wondering if it is possible to define a many2many relationship
> that has an extra field associated. For example a Person model and a
> PhoneNumber model which have a bidirectional relationship with each
> other. A person might have a work number and a personal number, the
> work number might be related to more than one Person.
> I was wondering if I could add a type field to the m2m mapping table
> and subclass the collection object to have it access that field as a
> key:
> $myPerson->PhoneNumbers['work']->getPhoneNumber();
> This would require a custom hydrator, but I can't seem to find info on
> it..
> Kindest regards,
> Marijn