CodeIgniter Forums
Transactions - transStatus method not found - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forum-30.html)
+--- Thread: Transactions - transStatus method not found (/thread-77194.html)



Transactions - transStatus method not found - acdc14 - 07-30-2020

I have a problem with transactions
I'm using 2 models in my back to save data, like $userModel and $userDataModel starting like this

// format and sanitize done

$userModel->transBegin()

$userModel->insert($mainData)
$userDataModel->insert($userData)

// some times this not work
if ($userModel->transStatus() === FALSE)
{
    // error, code..
} else {
    // good, code..
}

In codeigniter logs I have something like this

CRITICAL - [SOME DATE] --> Call to undefined method App\Models\UserModel::transStatus
#0 /PATH/TO/APP/Controllers/User.php(LINE): CodeIgniter\Model->__call('transStatus', Array)
#1 /PATH/TO/APP/system/CodeIgniter.php(914): App\Controllers\User->save()
#2 /PATH/TO/APP/system/CodeIgniter.php(400): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\User))
#3 /PATH/TO/APP/system/CodeIgniter.php(308): CodeIgniter\CodeIgniter->handleRequest(NULL, Object(Config\Cache), false)
#4 /PATH/TO/APP/public/index.php(45): CodeIgniter\CodeIgniter->run()
#5 {main}

Apache 2.4
PHP 7.3.3