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

Saving model passing to other class

Hello, I'd like to use a saver class to store model and do some actions within a transactions, like on user registration page Id like to use like

$userModel = new User([....]);
$saver = new SaverClass($userModel);
$saver->save();

SaverClass.php would look like


SaverClass {
    __construct($model)

    save()
    {
        ...do something
        $this->model->save(); <-- this part is not working for some reason and no exceptions and erros appear anywhere in log files (php, mysql logs)
        ..do something else
    }
}```


295
Accepted
answer

The problem was not with a model, or anything like that. ColumnMap was wrong and it dies silently in this case.