Welcome Guest, Not a member yet? Register   Sign In
Very unique / One time queries in model
#1

[eluser]Keyur Shah[/eluser]
Hello,

I'm trying to figure out how to organize my models in a way that the model code does not get cluttered by unique queries that get used only by a single controller. In the documentation and tutorials, i usually see CRUD type queries that are very generic and can be used my many controllers.

For example, here is one function in my orders model (along side the generic getAll, getSingle type queries)

Code:
function update_email_sent($ordernumber)
    {    
        if (isset($ordernumber)) {
            $data = array('EmailSent'=>1);
            $this->db->where("OrderNumber = $ordernumber");
            $this->db->update('Orders',$data);
        }
    }

Is there any other way of refactoring this function to keep the model page uncluttered by queries like this? Or should I create a new model page with the same name as the controller? Looking for some best practices.

Thanks!


Messages In This Thread
Very unique / One time queries in model - by El Forum - 06-24-2010, 12:26 PM
Very unique / One time queries in model - by El Forum - 06-24-2010, 01:05 PM
Very unique / One time queries in model - by El Forum - 06-25-2010, 08:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB