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

About Phalcon\Mvc\Model

I have a base model controller called Modelo. It has a protected static method search (it's just a refinated find()). I was creating to function to get his children caller class when I thought: "If I use another function that is also protected static, and from it call the original function, which model is used to do the find?".

And I discovered that it uses the base model controller. It is bad in terms of searching, or just doesn't mind which $model::find() is used? (for example, when searching users with Modelo::find()



98.9k

Maybe this has something to do with static binding? https://php.net/manual/en/language.oop5.late-static-bindings.php



33.8k

After reading, it would be, but I don't think so, because I tried doing self::find(...) for searching User in the base model controller Modelo, so I end with a Modelo::find(...) that searched an user...