Yii Framework Forum: Many To Many Relationship With More Than 2 Foreign Key Fields On Bridge Table. - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Many To Many Relationship With More Than 2 Foreign Key Fields On Bridge Table. Rate Topic: -----

#1 User is offline   batusa 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 30-October 12

Posted 19 November 2012 - 03:05 PM

Hi Guys!

Well.. I'd like to know how I can do a relationship many to many when I have the following situation:

TABLES:
- responsible: id, name, ...
- child: id, name, ...
- kinship: id, description, ...
- child_responsible: child_id, responsible_id, kinship_id

if it was just (child_responsible: child_id, responsible_id) the relationship would be like this:

Child model:
'responsibles' => array(self::MANY_MANY, 'Responsible', 'child_responsible(child_id, responsible_id)')


But in this case my table child_responsible has 3 fields.

How do I write my relationship?

I also wanna know a nice way to retrieve those data and save them from a webform.

Thank you very much.
0

#2 User is offline   batusa 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 30-October 12

Posted 20 November 2012 - 10:32 AM

Up!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users