Skip to content

Instantly share code, notes, and snippets.

@torian257x
Created April 18, 2023 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save torian257x/94a21e30af435a256e99d0501a6dd775 to your computer and use it in GitHub Desktop.
Save torian257x/94a21e30af435a256e99d0501a6dd775 to your computer and use it in GitHub Desktop.
/** @var ContainerAwareEventManager $evm */
$evm = $em->getEventManager();
foreach ($evm->getListeners() as $event => $listeners) {
foreach ($listeners as $key => $listener) {
if (str_starts_with($key, '_service_')) {
$listener = substr($key, strlen('_service_') );
}
$evm->removeEventListener([$event], $listener);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment