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

where to instatiate another class when __construct is final in ORM

As I'm integrating Phalcons ORM into my Project, I'm not able to use the default workflow. The refactoring would cost me to much time.

One problem for me is, that __construct is final. I have my own eventhandler that needs to be instantiated when the model is created. Where can I instatiate my eventhandler, that it is guaranteed that every model instance has its own eventhandler?



9.2k
Accepted
answer

I found the onConstruct() method. Sorry...