1

I've implemented the SonataAdmin and SonataUserBundle into my project. With this I've created the Application\Sonata\UserBundle which has a User entity. This entity uses xml-mapping for Doctrine. I'm wondering if it's possible to change this configuration to annotations as I'm using annotations in the rest of my project.

Thx.

mattyh88
  • 1,585
  • 5
  • 26
  • 48
  • Please also see this solution which works fine for me: http://stackoverflow.com/questions/14042010/annotations-in-extended-sonata-user-class-not-being-read – webDEVILopers Aug 13 '14 at 10:38

1 Answers1

1
sonata.user.admin.user:
      class: %sonata.user.admin.user.class%
      tags:
        - { name: sonata.admin, manager_type: orm, group: Usuarios, label: Usuarios }
      arguments: [null, %sonata.user.admin.user.entity%, SonataAdminBundle:CRUD]
      calls:
        - [ setUserManager, [fos_user.user_manager]]

where sonata.user.admin.user.class and .entity are values set in your config file.

You should probably change your fos_user.user_manager also but i don't know what you use...

Juan Mellado
  • 14,973
  • 5
  • 47
  • 54
Laurent Bertin
  • 151
  • 1
  • 5