Here is an example of a function within my code base for a third-party plugin I am building for EDD 3.0:
function delete_automation( $automation_id = 0 ) {
$automation_query = new Automation_Query();
// Pre-increase order coupon rule use count
do_action( 'eddot_pre_delete_automation', $automation_id );
$retval = $automation_query->delete_item( $automation_id );
// Pre-increase order coupon rule use count
do_action( 'eddot_post_delete_automation', $retval, $automation_id );
return $retval;
}
For almost all methods I had to add pre and post do_actions passing in the ID and return value, which bloats the code base a bit too much for my liking.
Much like the transition method hook, it would be useful to have these actions automatically generated for all the main CRUD methods. Ideally it should be possible to override that prefix too if you are building an add-on for another plugin (like EDD 3.0). Maybe this override could be defined in the query class schema or somewhere similar.