I have an object that needs to be notified when a hook function is called, and act on the data from the hook?
1 Answer
Probably the thing to do is create another extension that listens for the same hook and give it a sufficiently high priority such that it fires last (or perhaps immediately following the instance of the hook you are interested in if the hook is likely to be called multiple times).
Within your new extension you can then retrieve the data from the previous use of the hook using the variable $this->extensions->last_call
.
More on this in the documentation for EE4 here.
HTH