我想在我的News Entity
. 这是我的代码
新闻.yml
....
manyToOne:
gallery:
targetEntity: Application\Sonata\MediaBundle\Entity\Gallery
inversedBy: news_gallery
cascade: ["persist"]
nullable: true
图库.orm.xml
....
<one-to-many field="news_gallery"
target-entity="Wenweipo\NewsBundle\Entity\News"
mapped-by="gallery" />
新闻管理员.php
protected function configureFormFields(FormMapper $formMapper) {
$formMapper
->add('gallery', 'sonata_type_collection', array(
'cascade_validation' => true,
), array(
'edit' => 'inline',
'inline' => 'table',
'sortable' => 'position',
'link_parameters' => array(
'context' => 'images_news',
),
'admin_code'=>'sonata.media.admin.gallery_has_media'
))
}
现在,当我运行我的管理代码时,我收到了这个错误。
INVALID MODE : s543e4bf7bc21f_gallery - type : sonata_type_collection - mapping : 2
我做错了什么?