Welcome Guest, Not a member yet? Register   Sign In
ORM-like model implementation in CI
#3

[eluser]Jon L[/eluser]
there shouldn't be any naming conflicts, as you are able to pass a 2nd parameter when loading a model, that determines the namespace inhabited by the model.

example from my own code, I currently have 1 model called forums_model, that will represent both threads and categories (for the moment). so I instantiate 2 occurrences, and then I call a custom method "set_method" to let the model know if I'm using threads or categories. (there are some variable variables in the code, which is why I pass in categories vs threads)

Code:
$this->load->model('forums_model','categories');
        $this->categories->set_method('categories');

        $this->load->model('forums_model','threads');
        $this->threads->set_method('threads');


Messages In This Thread
ORM-like model implementation in CI - by El Forum - 08-09-2007, 02:24 AM
ORM-like model implementation in CI - by El Forum - 08-09-2007, 09:15 AM
ORM-like model implementation in CI - by El Forum - 08-10-2007, 06:15 AM
ORM-like model implementation in CI - by El Forum - 08-11-2007, 02:56 AM
ORM-like model implementation in CI - by El Forum - 08-11-2007, 09:10 AM
ORM-like model implementation in CI - by El Forum - 08-11-2007, 06:50 PM
ORM-like model implementation in CI - by El Forum - 08-16-2007, 11:52 AM
ORM-like model implementation in CI - by El Forum - 08-16-2007, 02:22 PM



Theme © iAndrew 2016 - Forum software by © MyBB