If it's your own component you can just override the delete method in your model, you don't need a plugin.
JModelAdmin
has a delete()
method, so in your Model:
class SomePrefixModelGallery extends JModelAdmin
{
/* all the standard methods */
/**
* Method to delete one or more records.
*
* @param array &$pks An array of record primary keys.
*
* @return boolean True if successful, false if an error occurs.
*
* @since 11.1
*/
public function delete(&$pks)
{
// Code to delete your image records
// Code to delete your image files
// Call the parent delete to remove the Gallery entry
parent::delete(&$pks);
}
}