Yii Framework Forum: AR Relation Foreign Key - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

AR Relation Foreign Key Rate Topic: ***** 3 Votes

#21 User is offline   Vishal Rathod 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 25-November 11
  • Location:Pune,India

Posted 20 March 2012 - 08:58 AM

View Postqiang, on 03 September 2009 - 07:30 PM, said:

Try this in relations:
'posts'=>array(self::HAS_MANY, 'TPosts', '', 'on'=>'tu_uid=uid'),


Basically, you rely on the 'on' option to join the tables rather than the FK constraints.



It's very useful.

Thanks a lot...
0

#22 User is offline   kevin tran 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 29-November 11

Posted 09 April 2012 - 11:13 AM

Thanks for the thread, it solves my problem too.
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

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