From 120b3fbf51b0844b1bc4a4de876ddb6ac567279d Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Thu, 13 Oct 2011 07:51:26 +0000 Subject: improved history - added BaseModel --- h-source/Application/Models/BaseModel.php | 43 +++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 h-source/Application/Models/BaseModel.php diff --git a/h-source/Application/Models/BaseModel.php b/h-source/Application/Models/BaseModel.php new file mode 100644 index 0000000..2f3a142 --- /dev/null +++ b/h-source/Application/Models/BaseModel.php @@ -0,0 +1,43 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class BaseModel extends Model_Tree +{ + + public function updateHistory($type) + { + $clean['created_by'] = (int)$this->values['created_by']; + $clean['last_id'] = (int)$this->lastId(); + + $history = new HistoryModel(); + $history->values = array( + 'created_by' => $clean['created_by'], + 'type' => sanitizeAll($type), + 'action' => "insert", + 'id' => $clean['last_id'], + 'message' => '', + 'gr' => 'registered', + ); + $history->insert(); + } + +} \ No newline at end of file -- cgit v1.2.3