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

Record Snapshots

i use this code to have snapshots

$user->username='ali';
$user->status='N';
$user->save();
$user->username='ali2';
var_dump($user->getChangedFields()); 
var_dump($user->hasChanged('username')); 
var_dump($user->hasChanged('status')); 

but i have this error : The record doesn't have a valid data snapshot' in phalcon/mvc/model.zep on line 3628

What do you get when you var_dump($user);

edited Apr '15
array (size=3)
  'id' => string '28' (length=2)
  'username' => string 'ali2' (length=4)
  'status' => string 'N' (length=1)

I think the snapshot is loaded when you do a find() to load a record. If you're just creating a record from scratch, then saving it - a snapshot doesn't get created.