entityManager->getDefinition($this->targetEntityTypeId); if (!$definition->get('field_ui_base_route') || !$definition->hasFormClasses()) { throw new NotFoundHttpException(); } $this->entity->setTargetType($this->targetEntityTypeId); } }