Update besar apk finance

This commit is contained in:
Wian Drs
2026-09-11 16:03:00 +07:00
parent d42483b350
commit 4ef15c22ae
897 changed files with 98056 additions and 15979 deletions
@@ -0,0 +1,29 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class TransactionService
{
private $CI;
public function __construct()
{
$this->CI =& get_instance();
}
public function run(callable $callback)
{
$this->CI->db->trans_begin();
try {
$result = $callback();
if ($this->CI->db->trans_status() === false) {
throw new RuntimeException('Operasi database gagal.');
}
$this->CI->db->trans_commit();
return $result;
} catch (Throwable $exception) {
$this->CI->db->trans_rollback();
throw $exception;
}
}
}