<?php
require_once (PATH_TABLES . "admin/UserResetPasswordHistoryTable.php") ;
require_once (PATH_MODELS . "base/MasterBase.php") ;

class UserResetPasswordHistoryClass extends MasterBase {
	
	function __construct($db) {
		$this->db = $db ;
		$this->tbl = UserResetPasswordHistoryTable::C_TABLE ;
		$this->fldid = UserResetPasswordHistoryTable::C_ID ;
	}
	function __destruct() {
	}
    function insertHistoryReset($id, $idTarget, $type = 0){
        
		$datas[] = $this->db->fieldValue(UserResetPasswordHistoryTable::C_ID,$id) ;
		$datas[] = $this->db->fieldValue(UserResetPasswordHistoryTable::C_ID_TARGET,$idTarget) ;
		$datas[] = $this->db->fieldValue(UserResetPasswordHistoryTable::C_TYPE,$type) ;
		$datas[] = $this->db->fieldValue(UserResetPasswordHistoryTable::C_DATE,(new DateTime())->format('Y-m-d H:i:s')) ;
        
        try {
            $this->addRecord($datas);
        } catch (Exception $e){
            Log::write("[UserResetPasswordHistoryClass]" . $e->getMessage());
        }
        
    }
}
?>