Some guy submitted a "multiple undo" type thing to the bakery. I thought it
was kinda clunky, but it gave me an idea for an improvement, which could
also be applied to your situation. Create a table for pending changes, and
save all submitted changes to that table in serialized form. Then you can
just unserialize and save to the actual db.

http://php.net/manual/en/function.serialize.php

<http://php.net/manual/en/function.serialize.php>The fields could be
something like:

id (auto-increment)
change_data (serialized array)
url (original url change was submitted to, eg - "posts/save/24")

On Wed, Jul 21, 2010 at 4:43 PM, Jay <[email protected]> wrote:

> so a database revision/version control module is not available for
> cakephp? =(
>
> On Jul 20, 10:54 am, "[email protected]" <[email protected]>
> wrote:
> > Drupal does something like this called revisions.  You could implement
> > a much simpler version of this in your application by adding 2 columns
> > to your database called revision and display.  Revision would just be
> > a revision number and you could use a timestamp as the field so it
> > would be unique and also keep track of creation time.  The display
> > column would just be a boolean showing which revision to show.  Then
> > you would implement some revision control actions in your controller
> > to manage the revisions.
> >
> > This would actually be awesome if generalized and written as a
> > behavior.  Unfortunately, I just don't have the time right now. :(
> >
> > On Jul 19, 6:01 pm, Jay <[email protected]> wrote:
> >
> > > ok guys, so here is the situation:
> >
> > > - we have built up a website using cakephp and it contains several
> > > models.
> > > - we want some users to be able to "make changes" to the database via
> > > webpage
> > > - but we want to audit the changes before they are actual made to the
> > > database
> >
> > > Our problem is, how do we know what the user changed if those changes
> > > are not "saved" the first time around. We are thinking of displaying a
> > > mock database and have the admin merge it with the real db. Is there
> > > any other way to tackle this?
> > > Thanks for all your inputs.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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]<cake-php%[email protected]>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

Reply via email to