Welcome Guest, Not a member yet? Register   Sign In
ActiveRecord for CodeIgniter: Rails-style model interactions
#95

[eluser]webthink[/eluser]
I've run into a fairly problematic namespace issue with this class.
It happens if one of your column names is the same as one of the models (or presumably libraries etc) you load then they get overwritten when trying to update using active record.

Consider the following case:
I have a table/model called category with the fields id, category
when you use $this->category->set_values(array(id=>1,id=>'vegetable'));
$this->category at that point ceases to hold your object and instead contains the string 'vegetable'
so any call you try to make after that like
$this->category->update(); will fail because it's not an object.

This will happen if any of your column names interfere with any of your models, or libraries or $this->anything you happen to load.

I'm considering changing active record to use an array called $table_data or something which set_values will write to and update and save methods will use. Can anyone see any problems with this approach?


Messages In This Thread
ActiveRecord for CodeIgniter: Rails-style model interactions - by El Forum - 03-27-2008, 02:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB