Call function on save?

Need to call a syncRoles() function inside User model after editing a user. Preferably only when roles_id changed but could call it always on save. How would I do so?
Was this page helpful?