@param Map    $map
@param string $eventName

@return string
194159
private function doRender(Map $map, $eventName)
    {
        $this->getEventDispatcher()->dispatch($eventName, $event = new MapEvent($map));

        return $event->getCode();
    }
1235138
public function getListeners(string $eventName) : array
    {
        if (!isset($this->events[$eventName])) {
            return [];
        }

        return $this->events[$eventName];
    }
1079557
public function addEntityListener(string $eventName, string $class, string $method) : void
    {
        $listener = [
            'class'  => $class,
            'method' => $method,
        ];

        if (! class_exists($class)) {
            throw MappingException::entityListenerClassNotFound($class, $this->className);
        }

        if (! method_exists($class, $method)) {
            throw MappingException::entityListenerMethodNotFound($class, $method, $this->className);
        }

        if (isset($this->entityListeners[$eventName]) && in_array($listener, $this->entityListeners[$eventName], true)) {
            throw MappingException::duplicateEntityListener($class, $method, $this->className);
        }

        $this->entityListeners[$eventName][] = $listener;
    }
1344759
protected function createEvent($eventName)
    {
        if (null === $this->defaultEvent) {
            return new Event($eventName);
        }
        $event = clone $this->defaultEvent;
        $event->setName($eventName);
        return $event;
    }
335925
function loadMap(map){
  if (!map)
  {
    /** @cut */ basis.dev.warn(namespace + '.loadMap(): Wrong value for map');
    return;
  }

  for (var key in map)
  {
    var eventsMap = map[key];

    if (!eventsMap)
    {
      /** @cut */ basis.dev.warn(namespace + '.loadMap(): Value of map should be an object for path: ' + key);
      continue;
    }

    var selector = parsePath(key);
    for (var events in eventsMap)
    {
      var data = eventsMap[events];

      events.trim().split(/\s+/).forEach(function(eventName){
        registrateSelector(selector, eventName, data);
      });
    }
  }
}
941851
public function dispatch($event/*, string $eventName = null*/)
    {
        if (null === $this->callStack) {
            $this->callStack = new \SplObjectStorage();
        }

        $currentRequestHash = $this->currentRequestHash = $this->requestStack && ($request = $this->requestStack->getCurrentRequest()) ? spl_object_hash($request) : '';
        $eventName = 1 < \func_num_args() ? \func_get_arg(1) : null;

        if (\is_object($event)) {
            $eventName = $eventName ?? \get_class($event);
        } else {
            @trigger_error(sprintf('Calling the "%s::dispatch()" method with the event name as first argument is deprecated since Symfony 4.3, pass it second and provide the event object first instead.', EventDispatcherInterface::class), E_USER_DEPRECATED);
            $swap = $event;
            $event = $eventName ?? new Event();
            $eventName = $swap;

            if (!$event instanceof Event) {
                throw new \TypeError(sprintf('Argument 1 passed to "%s::dispatch()" must be an instance of %s, %s given.', EventDispatcherInterface::class, Event::class, \is_object($event) ? \get_class($event) : \gettype($event)));
            }
        }

        if (null !== $this->logger && ($event instanceof Event || $event instanceof ContractsEvent || $event instanceof StoppableEventInterface) && $event->isPropagationStopped()) {
            $this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName));
        }

        $this->preProcess($eventName);
        try {
            $this->beforeDispatch($eventName, $event);
            try {
                $e = $this->stopwatch->start($eventName, 'section');
                try {
                    $this->dispatcher->dispatch($event, $eventName);
                } finally {
                    if ($e->isStarted()) {
                        $e->stop();
                    }
                }
            } finally {
                $this->afterDispatch($eventName, $event);
            }
        } finally {
            $this->currentRequestHash = $currentRequestHash;
            $this->postProcess($eventName);
        }

        return $event;
    }
643840
private function getEventStructure($eventName)
    {
        if (!$this->dumpSettings['skip-comments']) {
            $ret = "--".PHP_EOL.
                "-- Dumping events for database '".$this->dbName."'".PHP_EOL.
                "--".PHP_EOL.PHP_EOL;
            $this->compressManager->write($ret);
        }
        $stmt = $this->typeAdapter->show_create_event($eventName);
        foreach ($this->dbHandler->query($stmt) as $r) {
            $this->compressManager->write(
                $this->typeAdapter->create_event($r)
            );
            return;
        }
    }
731471
public function getEventLogInfo(Event $event, $eventName)
    {
        if (!$event instanceof DoctrineObjectEvent) {
            return null;
        }

        $this->initialize($event, $eventName);

        if ($this->isUpdateEvent() && null === $this->getChangeSets($this->entity)) {
            return null;
        }

        $reflectionClass = $this->getReflectionClassFromObject($this->entity);

        return array(
            'description' => $this->getDescription($reflectionClass->getShortName()),
            'type' => $this->getEventType($reflectionClass->getShortName()),
        );
    }
172379
protected function fetchEvent($eventName)
    {
        return (array_key_exists($eventName, $this->events)) ? $this->events[$eventName] : null;
    }
889864
public function onEndMap(Map $map)
    {
        $jbmap = $this->jukeboxService->getFirst();
        if ($jbmap) {
            try {
                $this->factory->getConnection()->chooseNextMap($jbmap->getMap()->fileName);
                $this->jukeboxService->removeMap($jbmap->getMap(), null, true);
            } catch (\Exception $e) {
                $this->jukeboxService->removeMap($jbmap->getMap(), null, true);
            }
        }
    }
796691
function getEvent(context, eventName) {
  if (!eventsMap.has(context)) {
    eventsMap.set(context, {});
  }
  const events = eventsMap.get(context);
  if (!events[eventName]) {
    events[eventName] = {
      listeners: [],
      meta: new WeakMap()
    };
  }
  return events[eventName];
}
691992
public function dispatch( $event_name, Event $event = null ) {

		if ( is_null( $event ) ) {
			$event = new Event();
		}

		do_action( $this->get_action_name_for_event( $event_name ), $event, $event_name, $this );

		return $event;
	}
412397
public function mapEvents()
    {
        if ($this->mapEvents) {
            return $this->mapEvents;
        }

        $events = $this->all();

        $out = [];
        foreach ($events as $ev) {
            $firstDate = $ev->startDate();
            $lastDate = $ev->endDate();

            $current = new DateTime();
            $current->setTimestamp($firstDate->getTimestamp());

            while ($current <= $lastDate) {
                $year = $current->format('Y');
                $month = $current->format('m');
                $day = $current->format('d');

                if (!isset($out[$year])) {
                    $out[$year] = [];
                }

                if (!isset($out[$year][$month])) {
                    $out[$year][$month] = [];
                }

                if (!isset($out[$year][$month][$day])) {
                    $out[$year][$month][$day] = [];
                }

                $out[$year][$month][$day][] = $ev;

                $current->modify('+1 day');
            }
        }

        $this->mapEvents = $out;

        return $this->mapEvents;
    }
605261
private function createEvent(Map $map, Marker $marker)
    {
        $formatter = $this->getFormatter();

        $rawEvent = new Event(
            $marker->getVariable(),
            $marker->getInfoWindow()->getOpenEvent(),
            $formatter->renderClosure($formatter->renderLines([
                $formatter->renderCall(
                    $formatter->renderProperty(
                        $formatter->renderContainerVariable($map, 'functions'),
                        'info_windows_close'
                    ),
                    [],
                    true
                ),
                $formatter->renderCode(
                    $this->getInfoWindowOpenRenderer()->render($marker->getInfoWindow(), $map, $marker),
                    true,
                    false
                ),
            ]))
        );

        $rawEvent->setVariable($marker->getVariable().'_info_window_open_event');

        return $rawEvent;
    }
34079
protected function getRoleIdentifierMap(array $map)
    {
        $rolesFromPolicy = $this->loadRolesFromPolicyFiles();

        foreach ($rolesFromPolicy as $newRoleIdentifier) {
            $map[substr($newRoleIdentifier, strrpos($newRoleIdentifier, ':') + 1)] = $newRoleIdentifier;
        }

        $map['Anonymous'] ='Anonymous';
        $map['Everybody'] = 'Everybody';

        return $map;
    }
177871
public function serializeEvent($name, Event $event)
    {
        $context = SerializationContext::create();

        return serialize(array(
            'name' => $name,
            'class' => get_class($event),
            'event' => $this->serializer->serialize($event, 'json', $context),
        ));
    }
630101
@SuppressWarnings("unchecked")
    public <T> T get(EventLocal<T> key) {
        EventLocalMap<EventLocal<?>, Object> map = getMap(key);
        if (null == map) {
            return key.initialValue();
        }
        return (T) map.get(key);
    }