src/EventsTrait.php
public function disableEventListeners(string $event)
    {
        $eventManager = $this->getEventManager();

        if (!\array_key_exists($event, $this->disabledListeners)) {
            $this->disabledListeners[$event] = [];
        }

        foreach ($this->getEventListeners($event) as $listener) {
            $eventManager->removeEventListener($event, $listener);

            $this->disabledListeners[$event][] = $listener;
        }
    }
public function disableEventListeners(string $event)
    {
        $eventManager = $this->getEventManager();

        if (!\array_key_exists($event, $this->disabledListeners)) {
            $this->disabledListeners[$event] = [];
        }

        foreach ($this->getEventListeners($event) as $listener) {
            $eventManager->removeEventListener($event, $listener);

            $this->disabledListeners[$event][] = $listener;
        }
    }
Disable all listeners for an event.

@param string $event