@param BundleInterface|null $bundle

@return mixed
967708
protected function getGenerator(BundleInterface $bundle = null)
    {
        $generator = new FardusCrudGenerator($this->getFilesystem(), '');
        $generator->setSkeletonDirs(__DIR__ . '/../Resources/skeleton');
        $this->setGenerator($generator);
        return parent::getGenerator($bundle);
    }
1319407
private function getFormGenerator($bundle = null)
    {
        $generator = new FormGenerator();
        $generator->setSkeletonDirs($this->getSkeletonDirs($bundle));

        return $generator;
    }
1342794
protected function getRequiredYvesBundleCodeGenerators($bundle)
    {
        return [
            $this->createYvesIndexControllerCodeGenerator($bundle),
            $this->createYvesIndexControllerProviderCodeGenerator($bundle),
            $this->createYvesIndexIndexTemplateCodeGenerator($bundle),
            $this->createYvesFactoryCodeGenerator($bundle),
        ];
    }
941145
private function getBundleValue(ResourceBundleInterface $bundle, string $key): array
    {
        return [
            BundleStorageInterface::INDEX_PAIR_VALUE  => $bundle->getValue($key),
            BundleStorageInterface::INDEX_PAIR_LOCALE => $bundle->getLocale(),
        ];
    }
1193918
protected function getRequiredZedBundleCodeGenerators($bundle)
    {
        return [
            $this->createZedDependencyProviderCodeGenerator($bundle),
            $this->createZedConfigCodeGenerator($bundle),
            $this->createFacadeInterfaceCodeGenerator($bundle),
            $this->createFacadeCodeGenerator($bundle),
            $this->createBusinessFactoryCodeGenerator($bundle),
            $this->createCommunicationFactoryCodeGenerator($bundle),
            $this->createGatewayControllerCodeGenerator($bundle),
            $this->createIndexControllerCodeGenerator($bundle),
            $this->createIndexIndexTemplateCodeGenerator($bundle),
            $this->createConsoleCodeGenerator($bundle),
            $this->createPersistenceFactoryCodeGenerator($bundle),
            $this->createQueryContainerCodeGenerator($bundle),
            $this->createQueryContainerInterfaceCodeGenerator($bundle),
            $this->createSchemaXmlCodeGenerator($bundle),
            $this->createNavigationXmlCodeGenerator($bundle),
        ];
    }
1167566
public void startBundle(Bundle bundle)
    {
        if (bundle != null)
            if ((bundle.getState() != Bundle.ACTIVE) && (bundle.getState() != Bundle.STARTING))
        {
            try {
                bundle.start();
            } catch (BundleException e) {
                e.printStackTrace();
            }
        }
    }
1069162
public static function getRootDir($bundlepath = false)
    {
        if (static::isSymfony()) {
            $dir = dirname(static::getCont()->getParameter('kernel.root_dir'));

            if (is_object($bundlepath)) {
                $path = get_class($bundlepath);
                $bundle = preg_replace('#^(.*?\\\\[^\\\\]+Bundle)\\\\.*$#', '$1', $path);
                if ($path !== $bundle) {
                    $bundle = str_replace('\\', '/', $bundle);

                    return static::getRootDir().'/src/'.$bundle;
                }
                throw new Exeption("Can't analyse path '$path' to find bundle directory");
            }
            if ($bundlepath) {
                return static::getKernel()->getBundle($bundlepath)->getPath();
    //            $n = get_called_class();
    //            $n = substr($n, 0, -strlen(strrchr($n, '\\')));
    //            $n = substr($n, 0, -strlen(strrchr($n, '\\')));
    //            $n = str_replace('\\', '/', $n);
    //            $dir .= "/src/$n";
            }

            return $dir;
        } else {
            if ($bundlepath !== false) {
                throw new Exception("This is not Symfony 2, can't user getRootDir with parameter");
            }
            // nie wiem czy to najlepsze ale najwyżej później to wymienie
            if (!static::$root) {
                $reflection = new ReflectionClass('Composer\Autoload\ClassLoader');
                static::$root = str_replace('\\', '/', dirname(dirname(dirname($reflection->getFileName()))));
            }

            return static::$root;
        }
    }
1296158
public static String get(Bundle bundle) {
    String applicationPath = ApplicationPath.get(bundle);
    if (applicationPath == null) {
      return null;
    }
    if (!hasHalDocs(bundle)) {
      return null;
    }
    return get(applicationPath);
  }
931644
public function getBundleIndex($projectId = null)
    {
        $url = sprintf($this->url_plan['get_bundle_index'], $projectId ?: $this->project_id);

        return $this->callService($url);
    }
694409
public function getBundle($name)
    {
        $bundle = null;
        if ($this->getContainer()->has('bundle.'.$name)) {
            $bundle = $this->getContainer()->get('bundle.'.$name);
        }

        return $bundle;
    }
1194674
public function attributes($bundle = null)
    {
        $key = empty($bundle) ? '@all' : $bundle;
        if (isset($this->_attributes[$key])) {
            return $this->_attributes[$key];
        }

        $this->_attributes[$key] = [];
        $cacheKey = $this->_table->table() . '_' . $key;
        $attrs = Cache::read($cacheKey, 'eav_table_attrs');

        if (empty($attrs)) {
            $conditions = ['EavAttributes.table_alias' => $this->_table->table()];
            if (!empty($bundle)) {
                $conditions['EavAttributes.bundle'] = $bundle;
            }

            $attrs = TableRegistry::get('Eav.EavAttributes')
                ->find()
                ->where($conditions)
                ->all()
                ->toArray();

            Cache::write($cacheKey, $attrs, 'eav_table_attrs');
        }

        foreach ($attrs as $attr) {
            $this->_attributes[$key][$attr->get('name')] = $attr;
        }

        return $this->attributes($bundle);
    }
1231314
@Override
	public Bundle getBundle(String bundleName) {
		final String sourceMethod = "getBundle"; //$NON-NLS-1$
		boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(FallbackBundleResolver.class.getName(), sourceMethod, new Object[]{bundleName});
		}
		Bundle result = Platform.getBundle(bundleName);
		if (isTraceLogging) {
			log.exiting(FallbackBundleResolver.class.getName(), sourceMethod, result);
		}
		return result;
	}
310856
public function find($class)
    {
        $reflectionClass = new \ReflectionClass($class);

        do {
            $classNamespace = $reflectionClass->getNamespaceName();
            foreach ($this->bundles as $bundleName => $bundleClass) {
                $bundleNamespace = \substr($bundleClass, 0, \strrpos($bundleClass, '\\'));
                if (0 === \strpos($classNamespace, $bundleNamespace)) {
                    return $bundleName;
                }
            }
            $reflectionClass = $reflectionClass->getParentClass();
        } while ($reflectionClass);

        return null;
    }
516851
private function getBundleFinder($baseDir)
    {
        $bundleBaseDir = $baseDir.self::BUNDLE_NAMESPACE;

        if (!(new Filesystem())->exists($bundleBaseDir)) {
            return null;
        }

        $bundleFinder = new Finder();
        $bundleFinder->directories()->in($bundleBaseDir)->depth('== 0')->notName('BundleBundle');

        return $bundleFinder;
    }
845844
public function createMigrationsLocation(BundleInterface $bundle)
    {
        return new MigrationsLocation(
            $bundle->getPath() . '/' . $this->relativeDirectory,
            $bundle->getNamespace() . '\\' . $this->relativeNamespace
        );
    }
1371306
public function getBundleIndex($projectId = null)
    {
        $projectId = $projectId ?: $this->project_id;

        return $this->callService($this->url_plan['get_bundle_index'], array(
                'project_id' => $projectId,
            )
        );
    }
485780
protected function findBasePathForBundle($bundle)
    {
        $path        = str_replace('\\', DIRECTORY_SEPARATOR, $bundle->getNamespace());
        $search      = str_replace('\\', DIRECTORY_SEPARATOR, $bundle->getPath());
        $destination = str_replace(DIRECTORY_SEPARATOR . $path, '', $search, $c);

        if ($c !== 1) {
            throw new RuntimeException(sprintf('Can\'t find base path for bundle (path: "%s", destination: "%s").', $path, $destination));
        }

        return $destination;
    }