Welcome Guest, Not a member yet? Register   Sign In
Calling other Model functions inside the Model
#1

[eluser]lookatthosemoose[/eluser]
Hi everyone. Quick question.

Is it possible to call one of the models other functions from within another function in the same model.

example:

Code:
function Address(){
        // Call the Model constructor
        parent::Model();
    }
    
    function get_alias_id($alias){
        $this->db->get_where('addresses',array('alias' => '$alias'));
        $query = $this->db->get('addresses');
        return $query->result();
    }
    
    function add(){
         $new_alias_id = get_alias_id($_POST['alias']);
    }
}

I've tried this->address->get_alias_id() and $this->get_alias_id() as well. No Luck.
I get this error -- Message: Trying to get property of non-object


Thoughts?

Thanks

--Eric--


Messages In This Thread
Calling other Model functions inside the Model - by El Forum - 02-27-2008, 07:01 PM
Calling other Model functions inside the Model - by El Forum - 02-27-2008, 07:11 PM
Calling other Model functions inside the Model - by El Forum - 02-27-2008, 07:29 PM
Calling other Model functions inside the Model - by El Forum - 02-27-2008, 08:44 PM
Calling other Model functions inside the Model - by El Forum - 02-28-2008, 10:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB