Welcome Guest, Not a member yet? Register   Sign In
Using model in a model
#3

[eluser]Craig A Rodway[/eluser]
I think it's a requirement that models are called with the _model suffix but this is how I do it:

Code:
class Location extends Model{
      public function get($ID){
                // Get main CI object handle and load model
                $CI =& get_instance();
                $CI->load->model('locationType_model');
                // Call new model functions using handle to main CI object
                $CI->locationType_model->setID($result->LocationTypeID);
                $CI->locationType_model->setTitle($result->TypeTitle);
                $this->_locationType = $CI->locationType;
                //Other Stuff
    }
}


Messages In This Thread
Using model in a model - by El Forum - 01-25-2008, 03:09 AM
Using model in a model - by El Forum - 01-25-2008, 03:32 AM
Using model in a model - by El Forum - 01-25-2008, 03:32 AM
Using model in a model - by El Forum - 01-25-2008, 03:40 AM
Using model in a model - by El Forum - 01-25-2008, 03:49 AM
Using model in a model - by El Forum - 01-25-2008, 03:52 AM
Using model in a model - by El Forum - 01-25-2008, 03:56 AM
Using model in a model - by El Forum - 01-25-2008, 11:37 AM
Using model in a model - by El Forum - 01-25-2008, 03:33 PM
Using model in a model - by El Forum - 01-25-2008, 04:07 PM
Using model in a model - by El Forum - 01-25-2008, 04:22 PM
Using model in a model - by El Forum - 01-25-2008, 07:44 PM
Using model in a model - by El Forum - 09-20-2009, 09:20 PM
Using model in a model - by El Forum - 09-20-2009, 09:43 PM
Using model in a model - by El Forum - 09-21-2009, 10:53 AM
Using model in a model - by El Forum - 09-21-2009, 11:12 AM
Using model in a model - by El Forum - 09-21-2009, 01:12 PM
Using model in a model - by El Forum - 09-22-2009, 07:24 PM
Using model in a model - by El Forum - 10-03-2009, 02:09 PM
Using model in a model - by El Forum - 05-21-2013, 09:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB