Get Listeners

@param bool $resultType

@return array
183205
public function getListeners($resultType = self::FULL_RESULT)
    {
        $listeners = [];

        foreach ($this->getEventDispatcher()->getListeners(CronEvent::NAME) as $listener) {
            $listenerClass = get_class($listener[0]);

            if (!$listener[0] instanceof CronEventListenerInterface) {
                $this->getLogger()->addError(sprintf('%s without %s', $listenerClass, CronEventListenerInterface::class));

                continue;
            }

            if (self::FLAT_RESULT === $resultType) {
                $listeners[] = $listenerClass;

                continue;
            }

            $type = $listener[0]::getRepeatedType();
            if (false === isset($listeners[$type])) {
                $listeners[$type] = [];
            }

            $listeners[$type][] = $listenerClass;
        }

        return $listeners;
    }
550828
public function get($type = FALSE)
  {
    $result = $this->peek($type);
	
    $this->clear($type);
	
    return $result;
  }
573633
public function getAllListeners() : array
    {
        foreach ($this->listeners as $event => $listeners) {
            if (! isset($this->sorted[$event])) {
                $this->sorted[$event] = $this->sortListeners($listeners);
            }
        }

        return $this->sorted;
    }
153927
public function getListeners($eventName = null)
    {

        if (empty($eventName)) return $this->listeners;
        if (!empty($eventName) && !isset($this->listeners[$eventName])) return [];

        return $this->listeners[$eventName];
    }
819708
public function addListener($callback)
	{
		$index = count($this->listeners);
		$this->listeners[] = $callback;
		return $index;
	}
488244
public function mapResult(ResultIterator $result, $resultType = ArrayType::BOTH) {
		//check numer of rows returned
		if ($result->countRows() == 0)
			return null;

		//get result column types
		$this->columnTypes = $result->getColumnTypes($resultType);
		
		//validate result map (if any)
		if (isset($this->resultMap))
			$this->buildTypeHandlerList();

		//map row
		return $this->map($result->fetchArray($resultType));
	}
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;
    }
1050923
protected function hydrateSearchResults($resultSet, $type)
    {
        $results = array();
        foreach ($resultSet->results as $result) {
            $results[] = $this->hydrateObject($result, $type);
        }
        unset($result);

        return (object)array(
            'offset'  => $resultSet->offset,
            'limit'   => $resultSet->limit,
            'total'   => $resultSet->totalMatchingRecords,
            'results' => $results,
        );
    }
347654
function listeners(type) {
    var me = this,
        events = me.events || (me.events = {});

    return hasKey(events, type) ? events[type] : (events[type] = []);
  }
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;
    }
639001
public static function get(string $messageType): array
    {
        $messages = $_SESSION[self::SESSION_KEY][$messageType] ?? [];

        unset($_SESSION[self::SESSION_KEY][$messageType]);

        return $messages;
    }
868937
public function listenersAction()
    {
        $dispatcher = $this->get('event_dispatcher');

        $listenerNames = array_keys($dispatcher->getListeners());
        sort($listenerNames);

        $output = '<pre>';
        $output .= str_repeat('=', 3).str_pad(' Events / Listeners ', 80, '=').PHP_EOL.PHP_EOL;

        foreach ($listenerNames as $listenerName) {
            $listeners = $dispatcher->getListeners($listenerName);

            $output .= $listenerName.' (<a href="#'.$listenerName.'">'.count($listeners).' listeners</a>)'.PHP_EOL;
        }

        foreach ($listenerNames as $listenerName) {
            $listeners = $dispatcher->getListeners($listenerName);

            if (!$listenerName) {
                $listenerName = '(global)';
            }

            $output .= PHP_EOL.PHP_EOL.str_repeat('-', 3).'<a name="'.$listenerName.'"></a>'.str_pad(' '.$listenerName.' ', 80, '-').PHP_EOL.PHP_EOL;

            foreach ($listeners as $listener) {
                if (is_array($listener)) {
                    if (is_object($listener[0])) {
                        $listener = get_class($listener[0]).'->'.$listener[1].'()';
                    } else {
                        $listener = implode('::', $listener).'()';
                    }
                }
                $output .= '* '.$listener.PHP_EOL;
            }
        }

        return new Response($output);
    }
650204
function listeners(type) {
      var object = this,
          events = object.events || (object.events = {});

      return _.has(events, type) ? events[type] : (events[type] = []);
    }
230463
protected function recv(bool $defer = false, bool $release = true)
    {
        if ($this->connection instanceof ConnectionInterface) {
            try {
                $result = $this->connection->receive();
            } catch (\Throwable $throwable) {
                throw $throwable;
            } finally {
                $this->release($release);
            }

            return $result;
        }

        try {
            $result = $this->connection->recv();
        } catch (\Throwable $throwable) {
            throw $throwable;
        } finally {
            if ($defer) {
                $this->connection->setDefer(false);
            }
        }

        return $result;
    }
971091
protected function _callListeners($listeners, array $arguments)
    {
        $execCount = 0;

        foreach ($listeners as $listener) {
            if ($result = $this->_callListener($listener, $arguments)) {
                return $result;
            }
            $execCount++;
        }

        return $execCount;
    }
637509
public function getListeners(string $event) : array
    {
        if (empty($this->listeners[$event])) {
            return [];
        }

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

        return $this->sorted[$event];
    }