Welcome Guest, Not a member yet? Register   Sign In
Jamie Rumbelow's Flare O/R Mapper for CI - anybody playing around with it?
#6

[eluser]peterphp[/eluser]
Hey Jamie,

first things first: Happy New Year :-)

I am now looking into the 'save' function of Flare and can't really get it to work. Here is what I am doing:

Code:
$this->load->library('flare');
$this->load->model('c_gmail_model');  // name of db table is 'c_gmails'

$gmail = new C_gmail();

$gmail->id  = '[email protected]';
$gmail->pwd = 'mysecretpwd';

$gmail->save();

This does not work at all.

I can improve it by adding these two lines to the Flare save() function:

Code:
get_instance()->load->database();
self::$db =& get_instance()->db;

With these two lines the inserting (of new ids) into db works, but in case the id already exists the system does NOT automatically switch over to 'update' as it should.

Maybe I am missing out just a simple step in my code, but I looked through all the Flare code and could not find any function that I might have to call before calling the save() function.

Thanks in advance for any hint.


Messages In This Thread
Jamie Rumbelow's Flare O/R Mapper for CI - anybody playing around with it? - by El Forum - 01-09-2010, 07:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB