We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Is there way to execute my function after reading object's data from DB but before creating object?

Hello.

My question is: Is there way to execute my function after reading object's data from DB but before creating object?

For ex, in \Phalcon\MVC\Model there are events: beforeCreate(), beforeUpdate(), beforeDelete()... but is there an event beforeRead() or something like that?



11.8k
Accepted
answer

if I understand correctly, you should use afterFetch(); but it works only for 1 object. not array objects.



36.0k

Thank you, for the answer. Now, I found it in the docs... probably in the docs for the 0.8 release (when I read it) there was not description of the such feature.