protected function askForBundleName(
        $objectName,
        $namespace = null,
        $questionMoreBundles = "\nIn which bundle do you want to create the %s",
        $questionOneBundle = "The %s will be created for the <comment>%s</comment> bundle.\n"
    ) {
        if (Kernel::VERSION_ID >= 40000) {
            return new Sf4AppBundle($this->getContainer()->getParameter('kernel.project_dir'));
        }

        $ownBundles = $this->getOwnBundles();
        if (count($ownBundles) <= 0) {
            $this->assistant->writeError("Looks like you don't have created any bundles for your project...", true);
        }

        // If the user provided the namespace as input option
        if (!is_null($namespace)) {
            foreach ($ownBundles as $key => $bundleInfo) {
                if (GeneratorUtils::fixNamespace($namespace) == GeneratorUtils::fixNamespace(
                        $bundleInfo['namespace']
                    )
                ) {
                    $bundleName = $bundleInfo['name'];

                    break;
                }
            }

            // When the provided namespace was not found, we show an error on the screen and ask the bundle again
            if (empty($bundleName)) {
                $this->assistant->writeError("The provided bundle namespace '$namespace' was not found...");
            }
        }

        if (empty($bundleName)) {
            // If we only have 1 bundle, we don't need to ask
            if (count($ownBundles) > 1) {
                $bundleSelect = [];
                foreach ($ownBundles as $key => $bundleInfo) {
                    $bundleSelect[$key] = $bundleInfo['name'];
                }
                $bundleId = $this->assistant->askSelect(
                    sprintf($questionMoreBundles, $objectName),
                    $bundleSelect
                );
                $bundleName = $ownBundles[$bundleId]['name'];

                $this->assistant->writeLine('');
            } else {
                $bundleName = $ownBundles[1]['name'];
                $this->assistant->writeLine(
                    [sprintf($questionOneBundle, $objectName, $bundleName)]
                );
            }
        }

        $bundle = $this->assistant->getKernel()->getBundle($bundleName);

        return $bundle;
    }