Welcome Guest, Not a member yet? Register   Sign In
Call, another model in a model
#15

[eluser]jwindhorst[/eluser]
The best way that I've found to deal with the CI approach to MVC is to not try to blast through it, but instead, create a higher road above it.

Let me explain a little. I use the models essentially to pull data from the DB, and to do complicated business processing. Then I use my own custom "libraries" to store individual Objects from the data that is pulled.

So, if I had a model called "Cars_model" with a method named "getAmerican()" which was going to return me a list of American cars, inside that method after I grabbed the db data, I would process the data through my custom libraries as:
Code:
while(looping through car data)
         {
             $car_list[]=new my_car($args);
         }

This way, I can manage my data view normal individual objects, but I'm not skirting around the way that CI sees the model.

Hope this helps!


Messages In This Thread
Call, another model in a model - by El Forum - 11-26-2008, 05:52 AM
Call, another model in a model - by El Forum - 11-26-2008, 06:51 AM
Call, another model in a model - by El Forum - 11-26-2008, 07:05 AM
Call, another model in a model - by El Forum - 11-26-2008, 07:07 AM
Call, another model in a model - by El Forum - 11-26-2008, 07:11 AM
Call, another model in a model - by El Forum - 11-26-2008, 07:26 AM
Call, another model in a model - by El Forum - 11-26-2008, 07:46 AM
Call, another model in a model - by El Forum - 11-26-2008, 07:57 AM
Call, another model in a model - by El Forum - 11-26-2008, 08:00 AM
Call, another model in a model - by El Forum - 11-26-2008, 08:39 AM
Call, another model in a model - by El Forum - 11-26-2008, 08:47 AM
Call, another model in a model - by El Forum - 11-26-2008, 05:57 PM
Call, another model in a model - by El Forum - 11-26-2008, 09:23 PM
Call, another model in a model - by El Forum - 11-27-2008, 08:01 AM
Call, another model in a model - by El Forum - 01-08-2009, 02:30 PM
Call, another model in a model - by El Forum - 01-08-2009, 07:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB