After reading and trying a few things, I discovered where there was an error. In my doctrine configuration, I have:
orm:
auto_generate_proxy_classes: "%kernel.debug%"
entity_managers:
default:
mappings:
ApplicationSonataMediaBundle: ~
SonataMediaBundle: ~
Having removed the auto_mapping clause, I no longer register the UserBundle in the doctrine description directories. Therefore, it cannot find your user object. Thus, the decision was either to uncomment auto_mapping: truefrom your configuration, or to comment on a part entity_manager.default.mappings, or explicitly indicate your User package in this section. So I choose the first one, and my code looks like this:
orm:
auto_generate_proxy_classes: "%kernel.debug%"
auto_mapping: true
source
share