@param string $eventName

@return bool
168089
public function contains($eventName)
    {
        foreach ($this->events as $event) {
            if ((string) new EventName($event) === $eventName) {
                return true;
            }
        }

        return false;
    }
1136302
public function getListeners( $eventName = NULL )
    {
        if ( NULL !== $eventName )
        {
            if ( !isset( $this->_sorted[ $eventName ] ) )
            {
                $this->sortListeners( $eventName );
            }

            return $this->_sorted[ $eventName ];
        }

        foreach ( array_keys( $this->listeners ) as $eventName )
        {
            if ( !isset( $this->_sorted[ $eventName ] ) )
            {
                $this->sortListeners( $eventName );
            }
        }

        return array_filter( $this->_sorted );
    }
704987
public boolean validateEventName(String eventName) {
        boolean isValid = false;
        if ((AuditConstants.validEventNamesList).contains(eventName))
            isValid = true;
        return isValid;
    }
1344759
protected function createEvent($eventName)
    {
        if (null === $this->defaultEvent) {
            return new Event($eventName);
        }
        $event = clone $this->defaultEvent;
        $event->setName($eventName);
        return $event;
    }
27730
public function hasListeners($eventName = null)
    {
        return ($this->symfonyDispatcher->hasListeners($eventName) ||
            $this->laravelDispatcher->hasListeners($eventName));
    }
1082186
public function flush($eventName)
    {
        $result = $this->dispatch($eventName . self::QUEUE_NAME);
        // If result is an array then need to merge or will end up with array of arrays.
        if (is_array($result)) {
            $result = call_user_func_array('array_merge', $result);
        }

        return $result;
    }
21450
private function executeListeners($eventName) {
        $listeners = $this->eventConfig[$eventName];
        foreach ($listeners as $listener) {
            $return = $this->classInvoker->invoke($listener);

            //如果某个事件监听器返回“false”，则停止事件的传播
            if ($return === false) {
                break;
            }
        }
    }
303267
public function getEventTypes($eventName) {
        $filter = is_array($eventName) ? $eventName : array(
            'EVENT_NAME' => $eventName,
        );

        $dbres = \CEventType::GetList($filter);
        return $this->fetchAll($dbres);
    }
1322728
public function getListeners(string $eventName = ''): array
    {
        $this->sortListeners($eventName);
        if ('' !== $eventName) {
            return \array_key_exists($eventName, $this->listeners) ? $this->listeners[$eventName] : [];
        }
        return $this->listeners;
    }
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;
    }
944830
protected function getListeners(string $eventName): array
    {
        if (!isset($this->listeners[$eventName])) {
            return [];
        }

        if (!isset($this->sortedListeners[$eventName])) {
            $this->sortedListeners[$eventName] = $this->sortEventListeners($eventName);
        }

        return $this->sortedListeners[$eventName];
    }
384723
public function getListeners($eventName)
    {
        $wildcards = $this->getWildcardListeners($eventName);

        if (! isset($this->sorted[$eventName])) {
            $this->sortListeners($eventName);
        }

        return array_merge($this->sorted[$eventName], $wildcards);
    }
435456
private function sortListeners(string $eventName)
    {
        krsort($this->listeners[$eventName]);
        $this->sorted[$eventName] = [];

        foreach ($this->listeners[$eventName] as &$listeners) {
            foreach ($listeners as $k => $listener) {
                if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure) {
                    $listener[0] = $listener[0]();
                }
                $this->sorted[$eventName][] = $listener;
            }
        }
    }
137860
public function exportEventTypes($eventName) {
        $exports = array();
        $items = $this->getEventTypes($eventName);
        foreach ($items as $item) {
            $exports[] = $this->prepareExportEventType($item);
        }
        return $exports;
    }
334013
public function removeListeners(string $eventName): void
    {
        foreach ($this->dispatcher->getListeners($eventName) as $listener) {
            $this->removeListener($eventName, $listener);
        }
    }
1190673
public function hasEventHandler($name)
    {
        $name = strtolower($name);
        return isset($this->_events[$name]) && count($this->_events[$name]) > 0;
    }
41716
public function hasListeners($eventName = '')
    {
        $count = 0;

        if (empty($eventName)) {
            $count = count($this->listeners);
        } elseif (isset($this->listeners[$eventName])) {
            $count = count($this->listeners[$eventName]);
        }

        return (boolean) $count;
    }