I've actually a problem with SonataAdminBundle
.
I have a file admin.yml:
sonata.admin.Produit:
class: Kayser\PlatformBundle\Admin\ProductionAdmin
tags:
- { name: sonata.admin, manager_type: orm, group: "Produits", label: "Les Pains & Viennoiseries" }
arguments:
- ~
- Kayser\PlatformBundle\Entity\Product
- ~
calls:
- [ setTranslationDomain, [KayserPlatformBundle]]
sonata.admin.Produit:
class: Kayser\PlatformBundle\Admin\ProductionAdmin
tags:
- { name: sonata.admin, manager_type: orm, group: "Produits", label: "Les Pains & Viennoiseries" }
arguments:
- ~
- Kayser\PlatformBundle\Entity\ProductImage
- ~
calls:
- [ setTranslationDomain, [KayserPlatformBundle]]`
and my productionAdmin.php:
class ProductionAdmin extends Admin
{
// Fields to be shown on create/edit forms
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add('description', 'text', array('label' => 'Description'))
->add('name')
->add('url', 'entity', array(
'class' => 'KayserPlatformBundle:ProductImage',
'property' => 'name',
'multiple' => true))
;
}
// Fields to be shown on filter forms
protected function configureDatagridFilters(DatagridMapper $datagridMapper)
{
$datagridMapper
->add('name')
->add('description')
->add('url', 'entity', array(
'class' => 'KayserPlatformBundle:ProductImage',
'property' => 'name',
'multiple' => true))
;
}
// Fields to be shown on lists
protected function configureListFields(ListMapper $listMapper)
{
$listMapper
->addIdentifier('name')
->add('description')
->add('url', 'entity', array(
'class' => 'KayserPlatformBundle:ProductImage',
'property' => 'name',
'multiple' => true))
;
}
}
and 2 entity Product.php
and ProductImage.php
(they have no problem).
So how to call my second entity with property ? :)