Adding preSave_table_name hook
Currently there is only postSave_table_name hook that run after a write operation on a core table that has an associated DAO. But in some cases it is useful to have a hook that run before the write operation.
An example whwre such hook is useful is when you cancel a membership contribution then the membership status will also change to Cancelled, but the cancellation of the membership does not trigger hook_civicrm_pre nor hook_civicrm_post hooks because this is how civicrm change the membership status when you cancel the membership :
hence that hook_civicrm_pre and hook_civicrm_post are invoked in the BAO class create method so doing anything using DAO directly as in the example above won't invoke any of these hooks and if you are planning to do any operation before editing the membership table in the case above then you are out of luck.
A new hook similar to postSave_table_name hook with the name preSave_table_name should be added to solve the issue mentioned issue.