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

Discover field changed

Hi, i have a simple ask! How i can discover what field was changed in model class?

Thanks so much!



9.3k
Accepted
answer

You have to enable snapshots and then you can use methods like getChangedFields or hasChanged

https://docs.phalcon.io/en/latest/reference/models.html#record-snapshots