I got a little problem with relationships that Ive been stuck on for a good few hours now and have run out of ideas, perhaps someone can help me out here. Im trying to get multiple Relationships to the Same Model to work:
A post (blog post) has a source where the actual content might come from, but it also has an image in it, that comes from somewhere, and i have called it "courtesy_id".
For example, you write an article about foo and reference the source to be foo.com and in the article you put an image as well, and the image was found on site bar.com
Now i can at the end say: Source: foo.com and image courtesy of: bar.com
This is how I have set up the relationships:
In POST model:
SELECT `sources`.* FROM (`sources`) LEFT OUTER JOIN `posts_sources` post_posts_sources ON `sources`.`id` = `post_posts_sources`.`_id` WHERE `post_posts_sources`.`_id` = 4
Which seem wrong to me, because its a 1:M relationship, with the foreign keys in the table, not in a join table.