linking on differently-named foreign keys

[prev] [thread] [next] [Date index for 2005/02/14]

From: Ofer Nave
Subject: linking on differently-named foreign keys
Date: 08:38 on 14 Feb 2005
Assume I have:

CREATE TABLE account ( account_id INT );
CREATE TABLE message ( sender_id INT, receiver_id INT );

Let's say I want to create my Account class, and use Account->has_many() 
to defined the methods inbox() and sent_mail().  Is there an elegant way 
to tell CDBI to lookup the rows in the message table where 
receiver_id=account_id for inbox() and sender_id=account_id for sent_mail()?

-ofer

(message missing)

linking on differently-named foreign keys
Ofer Nave 08:38 on 14 Feb 2005

Re: linking on differently-named foreign keys
Tony Bowden 08:47 on 14 Feb 2005

Re: linking on differently-named foreign keys
Tony Bowden 09:50 on 14 Feb 2005

Re: linking on differently-named foreign keys
Edward J. Sabol 20:00 on 14 Feb 2005

Generated at 17:31 on 15 Feb 2005 by mariachi v0.52