How to save data in an different table than the controller table when no relations?

Hi!

When a user modify something, the admin has to check before. so I'd like to save the changes in a temporary table until the admin check the changes.

I have a table "book" for the model Book and I ve created a table "book_admins" to store when a user modify datas. So datas in the table "book" will not change until the admin check.

I tried by using Controller::loadModel() but it doesn't work:


if (empty($this->data) == false) {
  $this->loadModel('BookAdmin');
  $result = $this->BookAdmin->save($this->data);
}

but cakephp show me that the request it makes is a describe on the table "book_admins"

I don't know how to do for this problem!

Why it doesn't work?

What could I use to do that?

Thanks

Asked by klick73, on 2/3/10

1 Answer

you should look at the revisions behavior. that might help you with what you are trying to do... or look at the code for book.cakephp.org it does the same thing you want.

http://github.com/cakephp/cookbook

http://bakery.cakephp.org/articles/view/revision-behavior-revision-control-made-easy

Answered by dogmatic69on 2/3/10

I looked at your links but didn't find how to do with my problem...

klick73 - on 2/3/10

<< comments | comments >>
<< previous next >>

Your Answer

You can use Creole Wiki Syntax to format your text.

Rating

0

Viewed

143 times

Last Activity

on 2/3/10