Welcome Guest, Not a member yet? Register   Sign In
Model singleton
#4

[eluser]ClaudioX[/eluser]
Thanks for the reply,

jondolar, i understand that to.

Damian, I was concerned about the issue you raised,
and you have completely solved, ty man!

but the original matter is: i think in aplication when i use more than one
model, and more than one time, if i have,

Code:
$this->load->model("pilot");
$this->load->model("race");

$this->pilot->setName("JJ");

$this->race->start();

//in the race model..
function start(){

$this->load->model("pilot");
$this->pilot->setName("BB king");

}

$this->pilot->save(); //is now BB king right?

In the fw i have worked, the the pilot will have two instaces, in CI I think not,
its thats a Domain question?

UPDATE:

Studing a way, i found ellislab.com/forums/viewthread/49625/#247644

now i think in the submodels, use this form to do a new load:

Code:
$this->load->mode('a_object');
$myObj = new a_object();

What do you think about? thats right?


Messages In This Thread
Model singleton - by El Forum - 05-25-2009, 08:59 AM
Model singleton - by El Forum - 05-25-2009, 11:16 AM
Model singleton - by El Forum - 05-25-2009, 11:18 AM
Model singleton - by El Forum - 05-25-2009, 02:54 PM
Model singleton - by El Forum - 05-25-2009, 03:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB