I describe you my situation: My model is : Teams, Template and Format The triple relation can be expressed in this way: Each team has access to a set of pairs template-format. A template can be associated with some format. In the table relative to this triple relation I have:
id team-id format-id template-id Then I have the models : Team,Format,Template On 16 Mag, 13:54, "[email protected]" <[email protected]> wrote: > Like this?: > > Message HasOne User (From) > Message HasOne ToUser (To) > Message HasOne CcUser (Copy) > > In message.php: > > var $belongsTo = array( > 'User' => array( > 'className' => 'User', > 'foreignKey' => 'user_id', > 'conditions' => '', > 'fields' => '', > 'order' => '' > ), > 'ToUser' => array( > 'className' => 'User', > 'foreignKey' => 'reciever_user_id', > 'conditions' => '', > 'fields' => '', > 'order' => '' > ), > 'CcUser' => array( > 'className' => 'User', > 'foreignKey' => 'cc_user_id', > 'conditions' => '', > 'fields' => '', > 'order' => '' > ) > ); > > Else, maybe polymorphic behavior might help. Not sure what you want to > achieve. > > On May 15, 6:36 pm, byqsri <[email protected]> wrote: > > > I haven't understand . > > Can you make me and example? > > Many Thanks > > > On 15 Mag, 17:56, AD7six <[email protected]> wrote: > > > > On May 15, 5:32 pm, "[email protected]" > > > > <[email protected]> wrote: > > > > Hi > > > > I have three model that have a triple relation between them. > > > > How can I manage this triple relation between Model in CAKEPHP? > > > > via belongsTo, hasMany and a model for each table - the usual way. > > > > hth, > > > > AD > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
