/** * @param NodeCreateEvent $event * * @throws \Exception */ public function createEntity(NodeCreateEvent $event) { $className = $this->registry->getRepository($this->lookupEntityName($event->getType()))->getClassName(); $event->setEntity(new $className()); }