I'm trying to solve a minor problem:
I would like to maintain an history fo INSERT, UPDATE and DELETE
commands. Among my tables, I have an history table, such as this:
CREATE TABLE history(
id SERIAL PRIMARY KEY,
who VARCHAR(32),
action VARCHAR(10),
parameters TEXT,
created TIMESTAMP
);
As a first approach, I hooked a piece of PHP code in my AppModel.php
afterSave() method.
But some questions arise:
1. the 'who' field in the history is the name of the user logged in,
saved in a Session variable. In a controller, it's easy to access with
the Session component. But within a Model, you can only access Session
variables via the $_SESSION PHP variable. Perhaps would it be better to
have sort of a 'user' member in the Member ? This question is merely a
question of design, but I would appreciate some advice, in order to
maintain an as 'clean' as possible MVC paradigm...
2. more difficult (I haven't found an easy way to do it): how can I log
UPDATE, INSERT or DELETE actions on join tables with HABTM association
?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---