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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.