0

I tried to get a list from using easy admin bundle items that have a OneToMany relation.

My Member entity :

/**
 * @ORM\OneToMany(targetEntity="Declaration", mappedBy="user")
 */
private $declarations;

My yaml file for Member:

list:
    fields:
        - { property: 'declarations', label: 'Label', template: 'type.html.twig'}

But I get the error

[Semantical Error] line 0, col 60 near 'declarations': Error: Invalid PathExpression. StateFieldPathExpression or SingleValuedAssociationField expected.

Draken
  • 3,134
  • 13
  • 34
  • 54
HareaCostea
  • 145
  • 9
  • please explain more.... what you are trying to do here? – habibun Apr 24 '19 at 09:43
  • @habibun I trying to liste all members with title of declarations – HareaCostea Apr 24 '19 at 10:53
  • Can you please send us the whole `easy_admin.yaml` and also the `type.html.twig`. Anyway you can't display the whole object, you have to specify the property of Declaration object as said in the documentation https://symfony.com/doc/master/bundles/EasyAdminBundle/book/list-search-show-configuration.html – D. Schreier Apr 25 '19 at 13:36

0 Answers0