Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
chihiro-adachi committed Apr 12, 2017
1 parent 34f9f19 commit 90b287b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions 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 All @@ -46,16 +47,15 @@ function (FormEvent $event) {
if (is_null($class)) {
return;
}
// Entityクラスのみ対象とする
$ref = new \ReflectionClass($class);
if ('Eccube\Entity\AbstractEntity' !== $ref->getParentClass()->getName()) {
return;
}
// TODO コンストラクタへ移動
$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 90b287b

Please sign in to comment.