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

regarding getModel() from Phalcon\Mvc\Model\Message

May I confirm that getModel() will only return the corresponding model if the save() has multiple models involved? For example books and authors are related, if I save either of them independently there will be a NULL when I getModel(); and I will get a model from getModel() if I am saving books. Is it correct? and is there anywhere in the doc mentioning this?

2015/4/28 update: today I found that MAY BE getModel() will return NULL if the message is from the model which call the save() itself. Still testing Phalcon.

Don't think your assumption is correct on a result only being returned when multiple models are involved. The example only seems to show one: https://docs.phalcon.io/en/latest/api/Phalcon_Mvc_Model_Message.html.

Since getModel() returns the model that produced the message if there are two the model with the exception will be returned.