public function dispatch($key, $arguments)
    {
        $event = new GenericEvent(
            $key,
            $arguments
        );

        $this->eventDispatcher->dispatch($key, $event);

        return $event;
    }
public function dispatch($key, $arguments)
    {
        $event = new GenericEvent(
            $key,
            $arguments
        );

        $this->eventDispatcher->dispatch($key, $event);

        return $event;
    }
public function dispatch ( $ key , $ arguments ) { $ event = new GenericEvent ( $ key , $ arguments ) ; $ this -> eventDispatcher -> dispatch ( $ key , $ event ) ; return $ event ; }
Notify Helper Create a generic event and dispatch the event

@todo move to WobbleCodeNotificationBundle

@param string $key       Event key name
@param array  $arguments Arguments with Organization included

@example of arguments

$arguments = [
'notifyLanguage' => 'es',
'notifyUserTrigger' => $user,
'notifyUsers' => [],
'notifyExternal' => 'notify@email.com',
'data' => [
'invitation' => $invitation
]
];

@return GenericEvent Dispatched event
Notify Helper Create a generic event and dispatch the event