Welcome Guest, Not a member yet? Register   Sign In
Call another model method within a transaction
#1

[eluser]kamikaz[/eluser]
Hi,

I'm facing an issue : is it possible to call a model function in an other model (yes we can but is it a good way ?) but within the same transaction ?

I explain myself:
Code:
<?php
class Model1 extends CI_Model
{
    //some code
    function function1()
    {
         $this->load->model('model2');
         $this->db->trans_start();
             $this->get_db_info();  //happens in transaction        
             $this->model2->get_db_info(); //doesn't happen in transaction
         $this->db->trans_complete();
    }
}

Do you have an idea how to deal with this ?
Thank you
#2

[eluser]kamikaz[/eluser]
Anybody ?
#3

[eluser]kamikaz[/eluser]
Still nobody ? It's very annoying Smile




Theme © iAndrew 2016 - Forum software by © MyBB