Welcome Guest, Not a member yet? Register   Sign In
logging db actions via model events and id problem
#3

(01-12-2022, 07:41 PM)kenjis Wrote:
(01-12-2022, 12:55 PM)dgvirtual Wrote: So, I have two questions:
1. Is there a better way to get what I want?
2. Is this behaviour of hooks something that I should report as a bug or "needs improvement" thing for the team developing Codeigniter? Or would changing this behaviour be too much to ask for (and if so, why)?

There is no ID value in your code. It seems it is impossible to know the ID value without querying to the DB.

It seems it is a bit better to extend CodeIgniter\Model event to add a query to lookup the ID value and pass it to the callback.
Ha, that sounds reasonable, but I have never done such an extension before. I looked up the BaseModel class of the Codeigniter and see no obvious way to do it...

If someone were to give me directions, that would perhaps ultimately benefit the whole community, so, I would be glad to do it with some help and write a tutorial later... Anyone?
==

Donatas G.
Reply


Messages In This Thread
RE: logging db actions via model events and id problem - by dgvirtual - 01-13-2022, 03:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB