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

Model's dirty state is only used for flagging brand new records? Not changed ones?

The dirty state only seems to tell me if the model is a brand new one that does not have a row in the database yet. But I also want to know if the model has been changed at all...

$Domain = Domain::findFirstByName('example.com'); // this row already existed
$Domain->name  = 'i have now modified one of the fields';
var_dump($Domain->getDirtyState()); // gives me 0 (DIRTY_STATE_PERSISTENT), I was expecting the model to be dirty

Is there an easy way to also determine if a model has been changed?