Neos.Neos/Classes/EventLog/Domain/Service/EventEmittingService.php
public function generate($eventType, array $data, $eventClassName = Event::class)
    {
        $this->initializeCurrentUsername();
        $event = new $eventClassName($eventType, $data, $this->currentUsername, $this->getCurrentContext());
        $this->lastGeneratedEvent = $event;

        return $event;
    }
public function generate($eventType, array $data, $eventClassName = Event::class)
    {
        $this->initializeCurrentUsername();
        $event = new $eventClassName($eventType, $data, $this->currentUsername, $this->getCurrentContext());
        $this->lastGeneratedEvent = $event;

        return $event;
    }
public function generate ( $ eventType , array $ data , $ eventClassName = Event :: class ) { $ this -> initializeCurrentUsername ( ) ; $ event = new $ eventClassName ( $ eventType , $ data , $ this -> currentUsername , $ this -> getCurrentContext ( ) ) ; $ this -> lastGeneratedEvent = $ event ; return $ event ; }
Generates a new event, without persisting it yet.

Note: Make sure to call add($event) afterwards.

@param string $eventType
@param array $data
@param string $eventClassName
@return Event
@see emit()
Generates a new event without persisting it yet .