Welcome Guest, Not a member yet? Register   Sign In
Loading Models
#1

[eluser]rob897[/eluser]
I have a couple models for this application and just noticed I needed to call one of the functions from another model...

dbs_model
Code:
class DBS_Model extends Model {

    function DBS_Model()
    {
        parent::Model();
        $this->load->model('account_model');
    }

account_model
Code:
class Account_Model extends Model {

    function Account_Model()
    {
        parent::Model();
        $this->load->model('dbs_model');
    }

Do these conflict each other as each one calls the other?
I have tried to autoload all my models in the config, but the one function within the dbs_model fails with the following error:
Code:
Severity: Notice

Message: Undefined property: Account_Model::$dbs_model

Filename: models/account_model.php

Line Number: 268

Fatal error: Call to a member function Backup() on a non-object

I know this may look confusing but I hit a dead end here and I not sure why I simple just couldn't load the dbs_model and call its function within the account_model..
If I leave the load dbs_model in the constructor, one of the functions with the account model actually prompts me to download a binary file... and as soon as I comment out the load dbs_model it works fine...

Help!!


Messages In This Thread
Loading Models - by El Forum - 10-24-2008, 12:48 PM
Loading Models - by El Forum - 10-27-2008, 08:27 AM
Loading Models - by El Forum - 10-27-2008, 08:43 AM
Loading Models - by El Forum - 10-27-2008, 09:11 AM
Loading Models - by El Forum - 10-27-2008, 09:21 AM
Loading Models - by El Forum - 10-27-2008, 09:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB