Retrieves all listeners for an event.

@param string $event
@return array
558893
public function getListeners($event)
    {
        if (!isset($this->listeners[$event]) || !is_array($this->listeners[$event])) {
            return array();
        }
        
        return $this->listeners[$event];
    }
597850
public function listeners($event): array
    {
        $name = \get_class($event);

        $localListeners  = $this->events[$name] ?? [];
        $globalListeners = static::$globalEvents[$name] ?? [];

        return array_merge($globalListeners, $localListeners);
    }
1345418
public function getListeners($event): array
    {
        $event = $this->getEventName($event);

        if (! $this->hasListener($event)) {
            return [];
        }

        if (! array_key_exists($event, $this->sortedListeners)) {
            $listeners = $this->listeners[$event];

            krsort($listeners);

            $listeners = call_user_func_array(
                'array_merge',
                $listeners
            );
            $this->sortedListeners[$event] = $listeners;

            unset($listeners);
        }

        return $this->sortedListeners[$event];
    }
634212
protected function getEventListeners($eventName)
    {
        $results = [];

        foreach ($this->eventDispatcher->getListeners($eventName) as $listener) {
            if ($listener instanceof \Closure) {
                $results[] = '{closure}()';
            } elseif (\is_object($listener[0])) {
                $results[] = \get_class($listener[0]);
            } elseif (\is_string($listener[0])) {
                $results[] = $listener[0];
            } else {
                $results[] = 'Unknown type!';
            }
        }

        return $results;
    }
1180817
public function trigger($event)
    {
        if ($this->has($event)) {
            return call_user_func($this->listeners[$event]);
        } else {
            throw new RuntimeException(sprintf(
                'Cannot trigger non-existing event "%s"', $event
            ));
        }
    }
1235138
public function getListeners(string $eventName) : array
    {
        if (!isset($this->events[$eventName])) {
            return [];
        }

        return $this->events[$eventName];
    }
93571
public function getListeners($event)
    {
        $parentListeners = [];
        $wildcards = [];

        if( is_object($event) )
        {
            $eventName = get_class($event);
            $parentListeners = $this->getParentListeners($event);
        }
        else
        {
            $eventName = $event;
            $wildcards = $this->getWildcardListeners($event);
        }

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

        return array_merge($this->sorted[$eventName], $wildcards, $parentListeners);
    }
154732
public function clearListeners($event = null)
	{
		if ($event)
		{
			$event = $this->resolveEventName($event);

			if (isset($this->listeners[$event]))
			{
				unset($this->listeners[$event]);
			}
		}
		else
		{
			$this->listeners = array();
		}

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

        $listeners = array_merge(
            $listeners,
            $this->getWildcardListeners($eventName)
        );

        return class_exists($eventName, false)
            ? $this->addInterfaceListeners($eventName, $listeners)
            : $listeners;
    }
835382
public function getArgs($event)
    {
        return [
            $event->getModel()->getPropertiesAsArray(),
            $event->getLabel(),
            new DcCompat($event->getEnvironment(), $event->getModel()),
            $event->getArgs()
        ];
    }
1149440
public function notify(Event $event)
    {
        $processed = false;
        foreach ($this->listeners as $listener) {
            if ($listener->match($event)) {
                $listener->handle($event);
                $processed = true;
                if ($event->isPropagationStopped()) {
                    break;
                }
            }
        }
        return $processed;
    }
554194
public function getListeners(string $event)
    {
        if (isset($this->listeners[$event])) {
            return $this->listeners[$event];
        } elseif (isset($this->classListeners[$event])) {
            return $this->classListeners[$event];
        }

        return [];
    }
1175095
public function getListenerQueue($event)
    {
        if ($event instanceof EventInterface) {
            $event = $event->getName();
        }

        if (isset($this->listeners[$event])) {
            return $this->listeners[$event];
        }

        return null;
    }
146960
protected function handleEvent($event)
    {
        if (!is_null($response = $this->call('event.*', array($event)))) {
            return $response;
        }

        $event['Event'] = strtolower($event['Event']);

        return $this->call("event.{$event['Event']}", array($event));
    }
1241990
private function getEventTags(Event $event)
    {
        return array_map(function ($value) {
            if (is_bool($value)) {
                $value = $value ? 'true' : 'false';
            }
            return $value;
        }, $event->getTags());
    }
872659
protected function collectListeners($event, array $args=[])
    {
        $event = $this->eventToString($event);

        $listeners = [];

        // Build args for * listeners
        array_unshift($args, $event);

        foreach ($this->root->getListeners('*', 'before') as $listener) {
            $listeners[] = function () use ($listener, $event, &$args) {
                return $this->callListener($listener, $event, $args);
            };
        }

        foreach ($this->root->getListeners($event, 'before') as $listener) {
            $listeners[] = $listener;
        }

        foreach ($this->root->getListeners($event) as $listener) {
            $listeners[] = $listener;
        }

        foreach ($this->root->getListeners('*') as $listener) {
            $listeners[] = function () use ($listener, $event, &$args) {
                return $this->callListener($listener, $event, $args);
            };
        }

        foreach ($this->root->getListeners($event, 'after') as $listener) {
            $listeners[] = $listener;
        }

        foreach ($this->root->getListeners('*', 'after') as $listener) {
            $listeners[] = function () use ($listener, $event, &$args) {
                return $this->callListener($listener, $event, $args);
            };
        }

        return $listeners;
    }
1374373
public static function emit($event)
    {
        if (isset(static::$events['__bow.once.event'][$event])) {
            $listener = static::$events['__bow.once.event'][$event];

            $data = array_slice(func_get_args(), 1);

            return $listener->call($data);
        }

        if (!static::bound($event)) {
            return false;
        }

        if (isset(static::$events[$event])) {
            $events = static::$events[$event];
        } else {
            $events = static::$events['__bow.transmission.event'][$event];
        }

        $listeners = new Collection($events);

        $data = array_slice(func_get_args(), 1);

        $listeners->each(function (Listener $listener) use ($data) {

            if ($listener->getActionType() === 'string') {
                $callable = $listener->getAction();
            } else {
                $callable = [$listener, 'call'];
            }

            return Actionner::getInstance()->execute($callable, [$data]);
        });

        return true;
    }