Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Models: call some code after fetch from database

Hello all. Sorry for my English.

I need to run some method in model object after fetching its data from database (for example, after find, findOne, etc.). I need run it after fetching because it need this data.

I tried to use onConstruct method, but at the time of its call data from database missing ($this->id is null and so on). Is there any other way to do this?

Overwrite the find() method in the model and populate your stuff inside it?

quasipickle, thx.

sorry for my blindness)