![]() |
Flare extension: 'my_save' provides auto-distinguish between 'insert' and 'update' - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Flare extension: 'my_save' provides auto-distinguish between 'insert' and 'update' (/showthread.php?tid=26247) |
Flare extension: 'my_save' provides auto-distinguish between 'insert' and 'update' - El Forum - 01-09-2010 [eluser]peterphp[/eluser] I very much like Jamie Rumbelow’s Flare O/R Mapper for CI, but I wanted to have a better 'save' method which can automagically distinguish between an insert (in case the provided id is currently NOT present in the db) and an update (in case the id is already there). This is useful for me as the ids are not created by my db but from external system sas I use email addresses as ids. So I created my own 'my_save' function, maybe this is useful for somebody else. Code: /** |