Created
April 18, 2023 12:30
-
-
Save torian257x/94a21e30af435a256e99d0501a6dd775 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @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