getLinks from an M-N jointure : multiple records ?
| From: | David Alia | Date: | Mon, 18 Jul 2005 15:52:13 +0000 |
| Subject: | getLinks from an M-N jointure : multiple records ? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-20038@lists.php.net to get a copy of this message | ||
Hello all,
Beginning with DataObjects, I've succeeded in using getLink and getLinks
features when tables are joined with a single key so far.
I mean (table names are uppercase) :
PERSON
ID
name
groupID
,
GROUP
groupID
name
To get the group of a person, I'm using : $person->getLink("groupID");
I have a new "challenge". Considering this schema :
PERSON
personID
name
,
GROUP
groupID
name
and now, a person can belong to multiple groups :
PERSGROUP
personID
groupID
Suppose I have the right db.links.ini.
How do I get :
- the list of all the persons in a group
- the list of all groups a person belongs to
Any explicit code would be extremely appreciated.
Thanks for your help
David