Re: How manage triple relation between Model in CAKEPHP?
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, j0n4s.h4rtm...@googlemail.com j0n4s.h4rtm...@googlemail.com 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 marco.rizze...@gmail.com wrote: I haven't understand . Can you make me and example? Many Thanks On 15 Mag, 17:56, AD7six andydawso...@gmail.com wrote: On May 15, 5:32 pm, marco.rizze...@gmail.com marco.rizze...@gmail.com 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How manage triple relation between Model in CAKEPHP?
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 marco.rizze...@gmail.com wrote: I haven't understand . Can you make me and example? Many Thanks On 15 Mag, 17:56, AD7six andydawso...@gmail.com wrote: On May 15, 5:32 pm, marco.rizze...@gmail.com marco.rizze...@gmail.com 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How manage triple relation between Model in CAKEPHP?
On May 15, 5:32 pm, marco.rizze...@gmail.com marco.rizze...@gmail.com 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How manage triple relation between Model in CAKEPHP?
And, if you have three habtm relations between model 1 and model2? On May 15, 5:56 pm, AD7six andydawso...@gmail.com wrote: On May 15, 5:32 pm, marco.rizze...@gmail.com marco.rizze...@gmail.com 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How manage triple relation between Model in CAKEPHP?
I haven't understand . Can you make me and example? Many Thanks On 15 Mag, 17:56, AD7six andydawso...@gmail.com wrote: On May 15, 5:32 pm, marco.rizze...@gmail.com marco.rizze...@gmail.com 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---