Welcome Guest, Not a member yet? Register   Sign In
Order of loading models
#1

[eluser]sabya[/eluser]
Is order of loading models important?
First, I have loaded a model 'user_auth' (auto loaded).
Then, I have loaded another model 'user', named as (from the controller).


'user_auth' uses the model 'user'.
There it is failing with the error: -

Code:
Message: Undefined property  : UserAuth::$user

So, my question as I told: -
Is the order of loading models important?
#2

[eluser]darkhouse[/eluser]
Most likely. I think it would make sense that if you're auto loading a model that is dependent on another model, you should auto load that one as well. I'm guessing it's auto loading your model, creating an instance and thus running the constructor which requires another model that hasn't been loaded yet, and that's why you're getting undefined property.




Theme © iAndrew 2016 - Forum software by © MyBB