Re: Question about saving info in two tables from 1 model
if you are using CakePHP 1.2, Behavior will definitely help in creating those logic in where/what table will the information be saved. checkout the Behavior::beforeSave() and other callback methods. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Question about saving info in two tables from 1 model
Its a design pattern http://en.wikipedia.org/wiki/Factory_method_pattern Basically it hides the fact that the UsersDetails models are different so that you can still use the same methods to access it. Geoff On 9/4/07, nerohc <[EMAIL PROTECTED]> wrote: > > > Thanks... but what is a factory object??? Sorry for my ignorance =S... > > On Sep 3, 7:32 pm, Geoff Ford <[EMAIL PROTECTED]> wrote: > > I would use a factory object to load a seperate model based on the > > user type. > > > > See this thread for a simliar problem > .http://groups.google.com/group/cake-php/browse_thread/thread/a2a14087... > > > > Geoff > > --http://lemoncake.wordpress.com > > > > On Sep 4, 6:08 am, nerohc <[EMAIL PROTECTED]> wrote: > > > > > Hi everyone. I'm new in this group and with cake too. I have this > > > problem: I have a Users table, which contains login, pass, etc. and 2 > > > tables with user's details. I use one or other table acording to the > > > user's group. For example if i register as a simple user, my details > > > would be saved in 'simple_details'. If my group is advanced users, > > > then my details would be saved in 'advanced_details'. My first thought > > > was to make a function that selects which table should use. However i > > > think that cake could have some way to do this. If there is any way, > > > please let me know. This is not a trouble really, is just curiousity. > > > > > Thank you > > > > > -- http://lemoncake.wordpress.com --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Question about saving info in two tables from 1 model
Thanks... but what is a factory object??? Sorry for my ignorance =S... On Sep 3, 7:32 pm, Geoff Ford <[EMAIL PROTECTED]> wrote: > I would use a factory object to load a seperate model based on the > user type. > > See this thread for a simliar > problem.http://groups.google.com/group/cake-php/browse_thread/thread/a2a14087... > > Geoff > --http://lemoncake.wordpress.com > > On Sep 4, 6:08 am, nerohc <[EMAIL PROTECTED]> wrote: > > > Hi everyone. I'm new in this group and with cake too. I have this > > problem: I have a Users table, which contains login, pass, etc. and 2 > > tables with user's details. I use one or other table acording to the > > user's group. For example if i register as a simple user, my details > > would be saved in 'simple_details'. If my group is advanced users, > > then my details would be saved in 'advanced_details'. My first thought > > was to make a function that selects which table should use. However i > > think that cake could have some way to do this. If there is any way, > > please let me know. This is not a trouble really, is just curiousity. > > > Thank 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 -~--~~~~--~~--~--~---
Re: Question about saving info in two tables from 1 model
I would use a factory object to load a seperate model based on the user type. See this thread for a simliar problem. http://groups.google.com/group/cake-php/browse_thread/thread/a2a140878b3094f1/05142a4f5055947c?lnk=gst&q=sonic+i+love+a+good&rnum=2#05142a4f5055947c Geoff -- http://lemoncake.wordpress.com On Sep 4, 6:08 am, nerohc <[EMAIL PROTECTED]> wrote: > Hi everyone. I'm new in this group and with cake too. I have this > problem: I have a Users table, which contains login, pass, etc. and 2 > tables with user's details. I use one or other table acording to the > user's group. For example if i register as a simple user, my details > would be saved in 'simple_details'. If my group is advanced users, > then my details would be saved in 'advanced_details'. My first thought > was to make a function that selects which table should use. However i > think that cake could have some way to do this. If there is any way, > please let me know. This is not a trouble really, is just curiousity. > > Thank 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 -~--~~~~--~~--~--~---
Question about saving info in two tables from 1 model
Hi everyone. I'm new in this group and with cake too. I have this problem: I have a Users table, which contains login, pass, etc. and 2 tables with user's details. I use one or other table acording to the user's group. For example if i register as a simple user, my details would be saved in 'simple_details'. If my group is advanced users, then my details would be saved in 'advanced_details'. My first thought was to make a function that selects which table should use. However i think that cake could have some way to do this. If there is any way, please let me know. This is not a trouble really, is just curiousity. Thank 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 -~--~~~~--~~--~--~---