Skip to content

Commit

Permalink
metadataの例外処理に対応
Browse files Browse the repository at this point in the history
  • Loading branch information
chihiro-adachi committed Apr 13, 2017
1 parent d7538ab commit d3d5fac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Eccube/Form/Extension/DoctrineOrmExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
namespace Eccube\Form\Extension;

use Doctrine\Common\Persistence\Mapping\MappingException;
use Eccube\Application;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\Extension\Core\Type\FormType;
Expand Down Expand Up @@ -50,7 +51,11 @@ function (FormEvent $event) {
$app = Application::getInstance();
$em = $app['orm.em'];
// メタデータの取得
$meta = $em->getClassMetadata($class);
try {
$meta = $em->getClassMetadata($class);
} catch (MappingException $e) {
return;
}
// フィールドからフォームへ定義
$names = $meta->getFieldNames();
foreach ($names as $name) {
Expand Down

0 comments on commit d3d5fac

Please sign in to comment.