val*_*lis 9 mongodb symfony-forms symfony
使用Entity时,我们可以通过表单字段类型实体从Entity加载选项
$builder->add('group', 'entity', array(
'class' => 'Fist\CoreBundle\Document\Group',
));
Run Code Online (Sandbox Code Playgroud)
但是当使用mongodb文档时,从Document中注入选择选项的最佳方法是什么?
在我的情况下从组文档加载所有组.有没有比传递给构造函数更好的方法呢?
谢谢你们
该学说的MongoDB ODM相当于EntityType是Symfony\Bundle\DoctrineMongoDBBundle\Form\Type\DocumentType.DocumentChoiceList,DocumentsToArrayTransformer和DocumentToIdTransformer,也包含在DoctrineMongoDBBundle中并且与它们的ORM等价物并行.
| 归档时间: |
|
| 查看次数: |
2890 次 |
| 最近记录: |