/** * function audit($logModelArray = array(), $methodCall = NULL, $idColumn = 'id', $logTable = 'log', $classCall = NULL) * Method to enable the audit log process. * This will write a log every time it INSERT, UPDATE, DELETE a record. */ public static function audit($logModelArray = array(), $methodCall = NULL, $idColumn = 'id', $logTable = 'log', $classCall = NULL) { self::$__audit = true; self::$hookTable = $logTable; MatchaModel::$tableId = $idColumn; if ($classCall == NULL) { self::$hookClass = get_called_class(); } else { self::$hookClass = $classCall; } self::$hookMethod = $methodCall; self::defineLogModel($logModelArray); }
/** * @brief MatchaHelper constructor. * @details This method starts the connection with mysql server using * $_SESSION values * during the login process. * * @author Gino Rivera (Certun) <*****@*****.**> * @version Vega 1.0 * */ function __construct() { self::$__freeze = false; // Connect to the database // This is compatible with the old methods if (defined('site_db_type')) { self::connect(array('host' => site_db_host, 'port' => site_db_port, 'name' => site_db_database, 'user' => site_db_username, 'pass' => site_db_password, 'app' => ROOT . '/app')); } self::$__secretKey = site_aes_key; MatchaAudit::$__audit = true; MatchaAudit::$hookTable = 'audit_transaction_log'; MatchaAudit::$hookClass = 'MatchaHelper'; MatchaAudit::$hookMethod = 'storeAudit'; MatchaModel::setSenchaModel('App.model.administration.TransactionLog'); MatchaModel::setSenchaModel('App.model.administration.AuditLog'); }
/** * @param bool $pause True to pause the audit log * @return bool */ public static function pauseLog($pause) { return MatchaAudit::$__audit = !$pause; }