@param string $eventName

@return EventResolverInterface
176967
protected function getResolver($eventName)
    {
        if ($this->isEntityEvent($eventName)) {
            return $this->entityEventResolver;
        }

        if (isset($this->resolverEventMap[$eventName]) && isset($this->customResolvers[$this->resolverEventMap[$eventName]])) {
            return $this->customResolvers[$this->resolverEventMap[$eventName]];
        }

        return $this->commonResolver;
    }
318770
public function fireEvent($eventName, Event $event = null)
    {
        /** @var EventDispatcher $events */
        $events = $this['events'];

        return $events->dispatch($eventName, $event);
    }
232644
public function dispatchUntil($eventName, Event $event)
    {
        // skip dispatching because event is already dispatched
        if ($event->isProcessed()) {
            return $event;
        }

        // skip dispatching because event hasn't listeners
        if (!$this->hasListeners($eventName)) {
            return $event;
        }

        $event->setName($eventName);

        foreach ($this->getListeners($event->getName()) as $listener) {
            if (call_user_func($listener, $event)) {
                $event->setProcessed(true);
                break;
            }
        }

        return $event;
    }
117643
protected function getListeners($eventName)
    {
        if (isset($this->listeners[$eventName])) {
            return $this->listeners[$eventName];
        }
        return null;
    }
693271
public function exportEventMessages($eventName) {
        $exports = array();
        $items = $this->getEventMessages($eventName);
        foreach ($items as $item) {
            $exports[] = $this->prepareExportEventMessage($item);
        }
        return $exports;
    }
706983
protected function sortListeners($eventName)
    {
        // If listeners exist for the given event, we will sort them by the priority
        // so that we can call them in the correct order. We will cache off these
        // sorted event listeners so we do not have to re-sort on every events.
        $listeners = isset($this->listeners[$eventName])
                            ? $this->listeners[$eventName] : [];

        if (class_exists($eventName)) {
            foreach (class_implements($eventName) as $interface) {
                if (isset($this->listeners[$interface])) {
                    foreach ($this->listeners[$interface] as $priority => $names) {
                        if (isset($listeners[$priority])) {
                            $listeners[$priority] = array_merge($listeners[$priority], $names);
                        } else {
                            $listeners[$priority] = $names;
                        }
                    }
                }
            }
        }

        if ($listeners) {
            krsort($listeners);

            $this->sorted[$eventName] = call_user_func_array('array_merge', $listeners);
        } else {
            $this->sorted[$eventName] = [];
        }
    }
1041387
protected function triggerEvent($eventName, NodeInterface $node = null)
    {
        if (isset($this->activeEvents[$eventName])) {
            $this->dispatcher->dispatch($eventName, $this->sharedEvent->setNode($node));
        }

        return $this;
    }
1238041
protected function sortEventListeners(string $eventName): array
    {
        $listeners = $this->listeners[$eventName];
        $normalised = [];

        ksort($listeners);

        foreach ($listeners as $priorityListeners) {
            foreach ($priorityListeners as $listener) {
                $normalised[] = $listener;
            }
        }

        return $normalised;
    }
544095
public function dispatch($eventName, sfEvent $event = null)
    {
        if (null !== $this->application) {
            $this->application->debug(sprintf('Dispatching `%s` event.', $eventName));
        }

        return parent::dispatch($eventName, $event);
    }
831701
private function sortListeners(string $eventName)
	{
        $listeners = &$this->listeners[$eventName];

		\krsort($listeners);
		$this->sorted[$eventName] = \array_merge(...$listeners);
	}
149340
public function unsubscribeEvent($eventName)
    {
        if (!isset($this->subscribedEvents[$eventName])) {
            throw new InvalidArgumentException("Event $eventName doesn't exists in client context");
        }

        $this->subscribedEvents[$eventName] = false;
    }
70163
public function getEventMessages($eventName) {
        $filter = is_array($eventName) ? $eventName : array(
            'EVENT_NAME' => $eventName,
        );

        $by = 'id';
        $order = 'asc';

        $result = array();
        $dbres = \CEventMessage::GetList($by, $order, $filter);
        while ($item = $dbres->Fetch()) {
            $result[] = $this->prepareEventMessage($item);
        }
        return $result;
    }
527053
public function removeAllListeners(string $eventName = null)
    {
        if (!\is_null($eventName)) {
            unset($this->listeners[$eventName]);
        } else {
            $this->listeners = [];
        }
    }
204187
public function getAccessLevelsForEvent($eventName)
    {
        if (!isset($this->items[$eventName])) {
            return false;
        }
        
        return $this->items[$eventName];
    }
415008
public function dispatch($eventName, Event $event)
    {
        if (!$this->hasListeners($eventName)) {
            return $event;
        }

        // setting event name
        $event->setName($eventName);

        // execute all callbacks for a event given
        foreach ($this->getListeners($event->getName()) as $listener) {
            call_user_func($listener, $event);

            if ($event->isPropagationStopped()) {
                break;
            }
        }

        return $event;
    }
96997
function removeAllListeners(string $eventName = null) {

        if (!\is_null($eventName)) {
            unset($this->listeners[$eventName]);
            unset($this->listeners_flat[$eventName]);
        } else {
            $this->listeners = [];
            $this->listeners_flat = [];
        }

    }
1364619
public function getListeners($eventName)
    {
        $listeners = $this->listeners[$eventName] ? $this->listeners[$eventName] : [];

        // Ordenar por prioridade
        krsort($listeners);
        $result = [];
        foreach ($listeners as $list) {
            foreach ($list as $listener) {
                $result[] = $listener;
            }
        }
        //$listeners = call_user_func_array('array_merge', $listeners);

        return $result;
    }