Implement a beforeSave() method.