Here is an example from a project I have that is similar Model JobMaterial var $belongsTo = array( 'Client' => array('className'=>'Client','foreignKey'=>'client_id'), 'Photographer' => array('className'=>'Client','foreignKey'=>'photographer_id'), 'Billto' => array('className'=>'Client','foreignKey'=>'billto_id'), );
Model Client var $hasMany = array( 'JobMaterial_Client' => array('className'=>'JobMaterial', 'foreignKey'=>'client_id'), 'JobMaterial_Photograper' => array('className'=>'JobMaterial', 'foreignKey'=>'photographer_id'), 'JobMaterial_Billto' => array('className'=>'JobMaterial', 'foreignKey'=>'billto_id'), ); see if that gives you a hint On 1/9/07, Alessandro Nuzzo <[EMAIL PROTECTED]> wrote: > > I have some problems to understand the association. > For example, I have a model 'User' and model 'Address'. > > User: > - id > - bla bla bla > - office_address : int -> address.id > - home_address : int -> address.id > > How can I define association between this 2 models? > > Thanks a lot! > > > > -- == S. DeVore (the old fart) the advice is free, the lack of crankiness will cost you --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---