Codeigniter - pyrocms intercept and modify all queries; extending active record?

By default you cannot extend the active record class. You can however, extend the active record class after extending the loader class database call to allow it.

By default you cannot extend the active record class. You can however, extend the active record class after extending the loader class database call to allow it: Instructions & code here: simonemms.com/code/extending-the-codeign....

Because it doesn't look like it. It looks like it is essentially creating a pseudo-helper to share methods across all models.Am I missing something? – stormdrain Nov 18 '11 at 0:41 It allows you to extend the active record class, if you can do that you can do what ever you want to the underlying queries before they are sent to the server.

– Louis Nov 18 '11 at 0:57 1 In other words you can override the _compile_select (for the where parts), _insert (for inserts), _update (for updates) etc etc these are base functions you need to update each of them as from there they call query() Unless you want to parse everything back out of the sql to do your encryption in query() (you don't) you may as well update each function where its pre compiled sql. – Louis Nov 18 '11 at 1:06 eggggggcelent. I'm actually using pyroCMS which has already extended the Loader class so it was just a matter of modifying that.

Thanks! – stormdrain Nov 18 '11 at 15:35 1 hmm not quite, its more of a least common denominator type deal, if you initialise an instance of DB_active_record it will use the insert from that class object regardless of what has been loaded, if you initialise a DB_mysql_driver (which extends DB_active_record) it will use the insert from the driver (if available, otherwise it will use the parent object's). You have to load (read: include|require) DB_active_record first as DB_mysql_driver extends the former.

– Louis Nov 18 '117 at 21:46.

You can't extend the active record class without modifying the core (which really sucks). So, you have a couple of options: Create a base model that implements the functionality you want, and extend that with your various models (this way you only do it once) Add the functionality to each model (not DRY) Overwrite the core files (not ideal) - it's only a few lines of code: robotslacker.com/2011/05/extending-codei....

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions