function logAction()
Stores a history item in the database, recording an add (i.e. insert), edit, or delete.
Should be called AFTER the action has been made.
N.B. This is a low-level method; the friendlier wrapper methods are preferred;
e.g. Controller::logAdd, Controller::logEdit Usageint $Controller->logAction ( string $table , int $record_id , int $type , array $data [, int $parent_log_id ] ); Arguments- string $table
The table which had data modified by the query - int $record_id
The id of the added/edited/deleted record - int $type
ENUM value from history_items.type - array $data
Data associated with an add/edit.
The handling differs based on the $type parameter:
'Add' ignored
'Edit' should be an array of the pre-update data, used to build a diff
'Delete' should contain the complete data of the deleted record
'Add category' should contain ['cat_id' => value]
'Delete category' should contain ['cat_id' => value]
'Change password' should be an empty array - int $parent_log_id = 0
ID of a parent log entry in the history_items table.
This is used when multiple records are deleted by a single action.
Undoing that action can then restore all of the deleted data.
N.B. This is only relevant for deletes
Exceptions thrown
Return value
|