I am currently attempting to create a fairly basic web app that has the potential to hold sensitive(ish) data for users and their organizations.
I had intended on storing all user entered record data in one db and all app data in another db.This data will be stored in a shared db with an user_id and org_id against all records in all tables to facilitate separation.
To minimize risk of code error and data compromise I have researched the ability to automatically append standard 'where' statements to my active record queries using Active Record Caching
$this->db->start_cache();
$this->db->where('user_id',$_SESSION['user_id']);
$this->db->where('org_id',$_SESSION['org_id']);
$this->db->stop_cache();
This is brilliant and will save a lot of headaches. However, According to the documentation http://codeigniter.com/user_guide/database/active_record.html#caching I should also be able to use this for updates (set method):
Note: The following statements can be cached: select, from, join, where, like, group_by, having, order_by, set.
Looking at the active_record class "DB_active_rec.php" there is code present to provide caching in several methods (select, where etc).
if ($this->ar_caching === TRUE)
{
...do caching stuff
From what I can tell this seems to be missing from the set method.
I'm not sure what answer I'm after but hopefully it will be that I'm just doing it wrong!