protected static function getBundleNameFromEntity($entityNamespace, $bundles)
    {
        $dataBaseNamespace = substr($entityNamespace, 0, strpos($entityNamespace, '\\Entity'));

        foreach ($bundles as $type => $bundle) {
            $bundleRefClass = new \ReflectionClass($bundle);
            if ($bundleRefClass->getNamespaceName() === $dataBaseNamespace) {
                return $type;
            }
        }

        return null;
    }
protected static function getBundleNameFromEntity($entityNamespace, $bundles)
    {
        $dataBaseNamespace = substr($entityNamespace, 0, strpos($entityNamespace, '\\Entity'));

        foreach ($bundles as $type => $bundle) {
            $bundleRefClass = new \ReflectionClass($bundle);
            if ($bundleRefClass->getNamespaceName() === $dataBaseNamespace) {
                return $type;
            }
        }

        return null;
    }
protected static function getBundleNameFromEntity ( $ entityNamespace , $ bundles ) { $ dataBaseNamespace = substr ( $ entityNamespace , 0 , strpos ( $ entityNamespace , '\\Entity' ) ) ; foreach ( $ bundles as $ type => $ bundle ) { $ bundleRefClass = new \ ReflectionClass ( $ bundle ) ; if ( $ bundleRefClass -> getNamespaceName ( ) === $ dataBaseNamespace ) { return $ type ; } } return null ; }
Get the bundle name from an Entity namespace

@param $entityNamespace
@param $bundles
@return string|null
Get the bundle name from an Entity namespace