Hi Dave,

It's exactly what I have done in a behavior, execpt that I store the
delta of before/after in it. I have also added in the behavior
paramtera specific "conditions" that can be used in find/findAll. If
this condition is set as a date, afterFind will search the table
"histo table" and find the records create between now and the
specified date.
The a "reverse" merge will be applied to "re-create" the record as it
was for the specified date.

However, just storing the delta is quite "consuming" (because it needs
to evaluate it), also you can sometimes update a record with same
value, so can be quite hard process.
Maybe it can be a good start ...

On Jan 16, 3:13 pm, Dave J <[EMAIL PROTECTED]> wrote:
> Hey guys, I was just thinking about this yesterday. I have by no means
> done any research on this at all, so... just throwing it out there
>
> What about a journal table (fieldnames:   id, model_name, model_id,
> data)?
>
> And before saving a record with the updated values, you save a
> serialized array of the existing record values in the journal table?
>
> That way you can view a history of any record, and maybe even use
> something like phpdiff to see the differences
>
> stupid idea or?
>
> On Jan 16, 2:42 pm, Adam Royle <[EMAIL PROTECTED]> wrote:
>
> > I am also interested in something like this. The tricky thing for me
> > to understand is how associations would be stored as well. Ideally it
> > would be great to be able to see a history of models and their
> > associated models without overwriting the "HEAD" revision. My
> > reasoning behind this is to have an easy way to implement multiple
> > drafts of models, without having to rewrite my controllers/views much
> > (or at all). This functionality could be used in a CMS for preview and
> > approval functionality.
>
> > On Jan 16, 8:42 pm, francky06l <[EMAIL PROTECTED]> wrote:> Hi bakers,
>
> > > I am wondering if someone already implemented an "historic" or
> > > "journal" with cake. Actually my need is to be able to keep trac of
> > > the changes on a record.
> > > Ideally, each modification would  a journal_id and I could roll back
> > > the journal to restore the data at any points.
> > > I have been searching the MySql triggers for this, but seems that
> > > performances are affected a lot.
> > > I have written a "small" behavior for it, but I am not 100% satisfied
> > > with this.
> > > If you have experimented something, I would be glad to know how to
> > > handle this (maybe another DB is better?).
>
> > > Another question; I haven;t check the code of the 1.2 beta for this :
> > > is the transactional mode fully implemented or I need a behavior for
> > > it  ?
>
> > > Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to