Welcome Guest, Not a member yet? Register   Sign In
Can you load models within models?
#1

[eluser]jleequeen[/eluser]
I'm getting the following error:

Quote:Fatal error: Call to a member function total_purchases_amount() on a non-object in C:\Apache2.2\htdocs\Local_Water_Supply_Plan\application\models\calculations_model.php on line 311

Here is the code the error references from my calculations_model.

Code:
function total_available_supply($pwsid, $year) {
        $this->load->model('purchases_model');
        $this->load->model('ground_model');
        $this->load->model('surface_model');
        
        $purchases = $this->purchases_model->total_purchases_amount($pwsid, $year);
        $surface = $this->surface_model->total_surface_amount($pwsid, $year);
        $ground = $this->ground_model->total_ground_amount($pwsid, $year);
        
        return $purchases + $surface + $ground;
    }

As you can see I'm trying to load some other models within my calculation model. Can you do this? Is that why it is throwing the error? Any help would be awesome.


Messages In This Thread
Can you load models within models? - by El Forum - 06-27-2008, 04:39 PM
Can you load models within models? - by El Forum - 06-27-2008, 06:29 PM
Can you load models within models? - by El Forum - 06-27-2008, 08:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB