0
我有实体:AdWCType
和AdWallType
。这些实体包含目录等静态数据。Symfony2实体类型字段持续存在
AdWallType
实体Ad
包含列wallType
和wcType
。
ADTYPE
$builder->add('wallType', EntityType::class, array(
'class' => 'AdBundle:AdWallType',
'choice_label' => 'title',
'query_builder' => function(EntityRepository $er) {
return $er->createQueryBuilder('wt')
->where('wt.visible = :visible')
->setParameter('visible', true)
->orderBy('wt.weight', 'ASC')
->setCacheable(true);
}
))
->add('wcType', EntityType::class, array(
'class' => 'AdBundle:AdWCType',
'choice_label' => 'title',
'query_builder' => function(EntityRepository $er) {
return $er->createQueryBuilder('wc')
->where('wc.visible = :visible')
->setParameter('visible', true)
->orderBy('wc.weight', 'ASC')
->setCacheable(true);
}
))
我如何能坚持wcType
和wallType
这是我对形式选用到实体Ad
提交?