Jump to content

Help: Association Mapping or JOIN, Doctrine2


xjermx

Recommended Posts

I've recently picked up CodeIgniter 2 + Doctrine 2, which is incredibly powerful.  I'm learning as I go.

 

I have what someone told me is called a 'join table'.  Two tables that only have useful information when linked together.

 

Its a messaging system in my webapp.  You send a message to three other users, it writes to two tables.  One table contains who its from, the message text, a timestamp and a primary key.  The second table contains a primary key, a "to" field, and a msg_id that is meant to join  back to the primary key in the other table.

 

If I was just using native sql statements, here's what this would look like:

 

SELECT *
        FROM mail_links a
        INNER JOIN mail_msgs b
        ON a.msg_id = b.id

 

But I'm trying to figure out what the "right" way is to do this in Doctrine2.

 

Is it Associative Mapping?  Is it something else?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.