ShopwareAG/shopware-4 — pull request #175 by svenmuennich (2014-09-03 16:55:03+00:00)
Title: Add 'unsubscribeEvent' method to 'Enlight_Plugin_Bootstrap_Config'

In some plugin updates it is desirable to remove old event subscriptions, since they are no longer used. This commit adds a new method to `Enlight_Plugin_Bootstrap_Config`, from which all plugin bootstrap implementations inherit.

The `unsubscribeEvent` method requires only the event name and listener name to remove an existing subscription, just like `subscribeEvent` requires those two parameters to add a subscription in the first place.

In order to make this work, it is also necessary to adapt the `write` method of `Shopware_Components_Plugin_Namespace`, so that the removed subscribes are also removed from the database. Therefore it has now an optional parameter of type `Shopware_Components_Plugin_Bootstrap`. If it is present, that plugin's subscribes will be fully synced, meaning that its removed subscribes will be deleted from the database.