public function generate(BundleInterface $bundle, $prefix, $rootDir, $demosite = false)
    {
        $this->bundle = $bundle;
        $this->prefix = GeneratorUtils::cleanPrefix($prefix);
        $this->rootDir = $rootDir;
        $this->demosite = $demosite;

        $parameters = array(
            'namespace' => $this->bundle->getNamespace(),
            'bundle' => $this->bundle,
            'bundle_name' => $this->bundle->getName(),
            'prefix' => $this->prefix,
            'demosite' => $this->demosite,
            'multilanguage' => $this->isMultiLangEnvironment(),
            'isV4' => $this->isSymfony4(),
        );

        $this->generateControllers($parameters);
        $this->generateAdminLists($parameters);
        $this->generateEntities($parameters);
        $this->generateFormTypes($parameters);
        $this->generateTwigExtensions($parameters);
        $this->generateMenuAdaptors($parameters);
        $this->generateFixtures($parameters);
        $this->generatePagepartConfigs($parameters);
        $this->generatePagetemplateConfigs($parameters);
        $this->generateConfig();
        $this->generateRouting($parameters);
        $this->generateTemplates($parameters);
    }