/** * Handle an event. * * @param EventInterface $event * * @return void */ public function handle(EventInterface $event) { if (!$event instanceof PlayerCreatedEvent) { return; } $applicationUser = $this->finder->find($event->getExternalReference()); $applicationUser->linkToPlayer($event->getGameId(), $event->getPlayerId()); $this->finder->save($applicationUser); }