for example i m having the 3 tables
- tab1 having 3 fields for primary members details
----tab1_id(PK)
----fname
----lname
data like
1-----test_firstname------test_lastname<br/>
2-----test2_firstname------test2_lastname
- tab2 having 4 fields for secondary members details
----tab2_id(PK)
----fname
----lname
----tab1_id(FK)
----count
data like
1----test1_firstname-----test1_lastname-----1-----1<br/>
2----test2_firstname-----test2_lastname-----1-----2<br/>
3----test1_firstname-----test1_lastname-----2-----1<br/>
and
- tab_data having combine details of the primary and secondary based upon the flag count field
----tab_data_id
----operation
----tab1_id(FK)
----count(FK)
now how i can write the conditional relation for the tab_data model class
i want to if count==0 then self belogns to tab1 using tab1_id field and if count>0 then self belogns to tab2 using tab1_id and count filed…
is it posssible in YII…!!!
thanks.