Welcome Guest, Not a member yet? Register   Sign In
Loop? problem with loading Models within Models
#1

[eluser]Unknown[/eluser]
I appologise if this is a stupid question, but I simply cannot work out what I need to do in this situation.

Basically, I have 2 models (let's call them Modela and Modelb) and I need to access some Modelb methods within Modela and vice versa.

I tried to load Modela from Modelb's consturctor and vice versa, but this causes fastcgi to bomb out with an error.

I am guessing this causes a loop of each model trying to load the other.

Is there some way to check a if model is currently loaded to use in an if(){} statement?

I tried to use
Code:
if (!isset(Modelb)){$this->load->model('Modelb')}
but it seems isset won't work with this.
Any ideas? Am I doing something fundamentally wrong here?


Edit: I'm really sorry - I just found another topic that deals with exactly this http://ellislab.com/forums/viewthread/142162/ . Guess I didn't search hard enough the first time. ^^




Theme © iAndrew 2016 - Forum software by © MyBB