From 2840f03409c2b55aa344b7404c4ccc686ffe43e1 Mon Sep 17 00:00:00 2001 From: Gyula Sallai Date: Wed, 9 Mar 2011 14:54:10 +0100 Subject: [PATCH] [DoctrineBundle][DoctrineMongoDBBUndle]Fixed generate:repositories throws exception using the general bundle naming conventions (VendorBundleName) --- .../Command/GenerateRepositoriesDoctrineCommand.php | 2 +- .../Command/GenerateRepositoriesDoctrineODMCommand.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/GenerateRepositoriesDoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/GenerateRepositoriesDoctrineCommand.php index a3882e2fa2..72d3ba2897 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/GenerateRepositoriesDoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/GenerateRepositoriesDoctrineCommand.php @@ -58,7 +58,7 @@ EOT } if ($metadata->customRepositoryClassName) { - if (strpos($metadata->customRepositoryClassName, $foundBundle->getName()) === false) { + if (strpos($metadata->customRepositoryClassName, $foundBundle->getNamespace()) === false) { throw new \RuntimeException( "Repository " . $metadata->customRepositoryClassName . " and bundle don't have a common namespace, ". "generation failed because the target directory cannot be detected."); diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/Command/GenerateRepositoriesDoctrineODMCommand.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/Command/GenerateRepositoriesDoctrineODMCommand.php index 694556d609..cc03639ffe 100644 --- a/src/Symfony/Bundle/DoctrineMongoDBBundle/Command/GenerateRepositoriesDoctrineODMCommand.php +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/Command/GenerateRepositoriesDoctrineODMCommand.php @@ -58,7 +58,7 @@ EOT } if ($metadata->customRepositoryClassName) { - if (strpos($metadata->customRepositoryClassName, $foundBundle->getName()) === false) { + if (strpos($metadata->customRepositoryClassName, $foundBundle->getNamespace()) === false) { throw new \RuntimeException( "Repository " . $metadata->customRepositoryClassName . " and bundle don't have a common namespace, ". "generation failed because the target directory cannot be detected.");