. 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; } }