give advice me how can I give foreign key relation in php

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

give advice me how can I give foreign key relation in php

tchristopher87
how can I give foreign key relation?
Reply | Threaded
Open this post in threaded view
|

Re: give advice me how can I give foreign key relation in php

rnwhite73
you can give foreignkey relation by defining "foreignKey" key in your belongsTo array of model file. e.g.

var $belongsTo = array(
   'ContentManagementFile' => array(
   'className' => 'ContentManagementFile',
   'foreignKey' => 'content_management_file_id',
   'conditions' => '',
   'fields' => '',
   'order' => ''
   )
 );