When an entry is created with my plugin's field type, data is saved to a separate table with entries id for reference. I need to delete that data if the entry that is associated with the data is deleted. How and where should I listen for entry delete event to execute a method to delete this separate data?
You can add something like this to your plugin's
Or, better yet, from your custom table, make sure the foreign key that you've created on your entryId column back to the entries table has a CASCADE DELETE setup on it so that when Craft deletes the entry, it will cascade down and delete it from your table as well.
Brad's answer is totally correct.
As the question was posed by the original asker, Brad provided an example of an event listener which would be triggered when an entry is deleted. He also mentions the CASCADE DELETE capabilities of a Record.
In my opinion, the absolute best way to achieve what you're doing is by properly setting up your Record. In your defineRelations method, you can create a proper relationship between your table and the main elements table...