This is not something that is handled automatically (by any web language/framework afaik). It is something you'll need to build into your application depending on your needs. You could easily create a Behavior that could do this checking for you in the model, in a beforeSave callback. You'd still need to add the timestamp field manually into your forms.
Cheers, Adam On Jun 9, 10:31 pm, Marc MENDEZ <[EMAIL PROTECTED]> wrote: > Hi, > > As a new comer to cakePHP, I have a few question with access to database. > Is there a simple way, with CakePHP, to handle dual access to a same > record ? > Example : > > Two users read the same data (let's say, the same record of a table). > The first one edit and save this record ; the second user does the same > thing. Of course, the changes committed by the second one will replace > the changes made by the first user... > > How can I handle easily this situation? I know it's not easy. Even if > it's not perfect solution, isn't there a way to warn the second user the > data changed when he commits ? > Isn't there a plugin to handle this ? > I could add a column containing a timestamp. It's read at the same time > as the other cols. When I save the record, I check if the timestamp > changed. If so, I raise an error. Otherwise, I update the timestamp too > and commit. > > I would be very disappointed if there was no mechanism to handle this. > > Thanks for you light. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
