I have made a custom block in my module.
Is there a method I can override in my block class (which extends BlockBase) to respond to block deletion? I have to delete something when my block is deleted. I can see that Entity (and Block) classes have preDelete() and postDelete() static methods as well as the delete() method itself, but I don’t understand how it relates to BlockBase and its interfaces.
Or do I just have to use hook_block_delete() – i.e. hook_ENTITY_TYPE_delete() – in the .module file? Unfortunately when I do that I can’t seem to access the configuration. BlockBase::getConfiguration() doesn’t exist on the Block that is passed in.