пятница, 1 июля 2016 г.

Sonata-admin how to add entity filter

protected function configureDatagridFilters(DatagridMapper $datagridMapper){    $datagridMapper        ->add('id')        ->add('translations.name', null, ['label' => 'Name'])        ->add('eanCode')        ->add('catalogCode')        ->add(            'product', null, [], 'entity', [            'class'    => 'AppBundle\Entity\Product',            'property' => 'name'        ])    ;}

In the beginning I thought that 'entity' doesn't work in sonata-admin ^2.3, 
and tried 'doctrine_orm_choice'. It could get elements in dropdown, but filter didn't 
worked correctly (results always was empty, but there should be elements).

Комментариев нет:

Отправить комментарий