I have the beforeSave function in my model that hashes the password. I'm using transactions in my controller - which are dependent on the save of other models too.
My problem is that on the view page, the hashed password gets returned if the other models fail the transaction.
Any idea how I can trigger beforeSave only once the entire transaction has been committed?
Thanks in advance!
My problem is that on the view page, the hashed password gets returned if the other models fail the transaction.
Any idea how I can trigger beforeSave only once the entire transaction has been committed?
Thanks in advance!