From 232aa1924c8c0f10d87b210b46c9f061af5c844c Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sun, 17 Oct 2010 13:29:57 +0000 Subject: added files --- h-source/Application/Models/RevisionsModel.php | 48 ++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 h-source/Application/Models/RevisionsModel.php (limited to 'h-source/Application/Models/RevisionsModel.php') diff --git a/h-source/Application/Models/RevisionsModel.php b/h-source/Application/Models/RevisionsModel.php new file mode 100644 index 0000000..203da64 --- /dev/null +++ b/h-source/Application/Models/RevisionsModel.php @@ -0,0 +1,48 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class RevisionsModel extends Model_Tree { + + public $id_user = 0; + public $type = ''; //device type + + public function __construct() { + $this->_tables='revisions'; + $this->_idFields='id_rev'; + + $this->_where=array( + 'id_hard'=>'revisions' + ); + + $this->orderBy = 'id_rev desc'; + + parent::__construct(); + } + + public function getIdHard($id_rev = 0) + { + $clean['id_rev'] = (int)$id_rev; + + $res = $this->db->select('revisions','id_hard','id_rev='.$clean['id_rev']); + + return (count($res) > 0) ? $res[0]['revisions']['id_hard'] : 0; + } + +} \ No newline at end of file -- cgit v1.2.3