Welcome Guest, Not a member yet? Register   Sign In
custom class/model advice


I'm working on building classes and using CI to access it - basically I just want to use the CI database driver - and then I'm going to put my control logic in the controllers. But I'm not sure where to put my "business" logic.

example - I'm working on a shipping notification interface. I have orders that have items and I would like them to be nice objects (eg, $order->isComplete(), $order->hasShipping(), etc.)

for the time being I've created a model and put my logic in there:
$order = $this->Order;
So far this has worked fine - the problem is that I want to do things like
$all_orders = $order->getAllOrders();
and have it return an array of objects.

I've run into a big of a snag in that inside my order model I haven't figured out how to return objects - and I'm starting to feel if I'm pounding a round peg in a square hole.

Can anyone give advice on how to do this - should I be building "libraries" instead of models?



Messages In This Thread
custom class/model advice - by El Forum - 01-20-2008, 06:57 AM
custom class/model advice - by El Forum - 01-20-2008, 02:13 PM

Theme © iAndrew 2016 - Forum software by © MyBB