Welcome Guest, Not a member yet? Register   Sign In
Can Hooks be used to capture all CUD operations in CI3?
#1

(This post was last modified: 10-08-2021, 02:43 AM by Ahirsi.)

I have a CodeIgniter 3 application and would like to create an audit trail of all CUD operations and save them
to individual audit tables.

Under each CUD statement in the code I wrote $this->db->last_query() to capture the query and save it to an audit table
together with the table name, operation type.

My question is how can I use CI hooks to accomplish the same. Is that even the proper use or capability of hooks?

Is it possible to grab each CUD query that is run including the relevant controller and method the query exists in?

How can that be setup?

AHirsi
Reply




Theme © iAndrew 2016 - Forum software by © MyBB