Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Many 2 Many with extra field
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Marijn  
View profile   Translate to Translated (View Original)
 More options 7 Nov, 19:29
From: Marijn <marijn.huizendv...@gmail.com>
Date: Sat, 7 Nov 2009 11:29:15 -0800 (PST)
Local: Sat 7 Nov 2009 19:29
Subject: [2.0] Many 2 Many with extra field
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


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "[2.0] Many 2 Many with extra field" by Roman Borschel
Roman Borschel  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 09:03
From: Roman Borschel <r.borsc...@gmx.net>
Date: Sun, 8 Nov 2009 10:03:42 +0100
Local: Sun 8 Nov 2009 09:03
Subject: Re: [doctrine-user] [2.0] Many 2 Many with extra field
Hi,

this has been asked many times before. We should probably add it to a  
FAQ.

http://groups.google.com/group/doctrine-user/browse_thread/thread/490...

A good start is always to ask yourself: How would you do it in plain  
OOP?

Roman

On Nov 7, 2009, at 8:29 PM, Marijn wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google