![]() |
Call to undefined method App\Models\[...]::transStart - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Call to undefined method App\Models\[...]::transStart (/showthread.php?tid=78061) |
Call to undefined method App\Models\[...]::transStart - webdevron - 11-25-2020 My model function is given bellow: PHP Code: class Product extends Model There is a strange problem. PHP Code: model->saveProduct(true); // This is working fine PHP Code: model->saveProduct(false); // This is not working. Showing error: RE: Call to undefined method App\Models\[...]::transStart - neoneeco - 11-25-2020 1) Have you tested without this method? (commenting it) 2) It may seem obvious, is this method well implemented ? the code doesn't show it, with the closing class brace. RE: Call to undefined method App\Models\[...]::transStart - InsiteFX - 11-25-2020 PHP Code: $this->db->transStart(); RE: Call to undefined method App\Models\[...]::transStart - webdevron - 11-29-2020 (11-25-2020, 06:22 AM)neoneeco Wrote: 1) Have you tested without this method? (commenting it) Thank you for your response. 1. Without transection, both method are doing as expected. Code: model->saveProduct(true); // Saving product With transection only the update product "model->saveProduct(false);" showing the error. 2. This method is a part of a large class. Everything is doing well except the update method. (11-25-2020, 03:43 PM)InsiteFX Wrote: I am not using Query Builder. Using inherited Codeigniter model instead. Again those method are not working just for PHP Code: model->saveProduct(false); RE: Call to undefined method App\Models\[...]::transStart - ojmichael - 11-29-2020 PHP Code: $info['updated'] = time(); Why is this line using the variable $info and not $val (like the rest) ? RE: Call to undefined method App\Models\[...]::transStart - webdevron - 11-30-2020 (11-29-2020, 11:34 PM)ojmichael Wrote: This is using in the last line where assigning the value: PHP Code: $val['product_info'] = json_encode($info); RE: Call to undefined method App\Models\[...]::transStart - InsiteFX - 11-30-2020 I would check the model code, because an update requires that an id field be passed to it. |