Register a Behavior listener to perform action on Table::removeBehavior()

I wonder if there is a method to register a listener on a Behavior so that when it is removed from a Table it can perform some action.

I have a Behavior that creates table associations when it’s added to a table. I would like to register a listener on that behavior so that removing the behavior from table the associations are removed too. I would put all the logic in the Behavior to decouple it from Table.

I didn’t found any event triggered on removing behaviors.

I’m not sure but maybe you can do this by overriding and adding removeBehavior here?

Mmmm… I don’t think so. That method maps events to some listener, but then I miss the trigger.

I could do it overriding Table::removeBehavior() and trigger an event (for example Model.removeBehavior) on which hook my listener.

But I hoped to not involve modifing on Table classes.