Missing arguments:
You probably have to provide the arguments:
to the service definition.
App\Blocks\:
resource: '../src/Blocks'
tags: ['controller.service_arguments']
arguments:
- '@doctrine.orm.default_entity_manager'
@
is used to not interpret the name as a simple string but to fetch the actual service instead.
Default Doctrine naming:
The naming is a little bit tricky; this answer made me understand how the naming is built: <entitymanager_name> (according to the doctrine.orm.entity_managers
YAML definition) concatenated to _entity_manager
.
With the special case of the default
one that is available as doctrine.orm.default_entity_manager
even when not explicitly defined in the above mentioned config key.
My assumption:
I tried on my app to just add that string as an argument and it didn't fail. Then I put a typo, and it failed. So I assume that default_entity_manager
is defined automatically (I am not sure where).
Otherwise:
In case it doesn't work, the other fix would be to verify why the entityManager is not automatically wired. Check your config for autowiring the src/
folders.
App\:
resource: '../src/*'
exclude: '../src/{DependencyInjection,Tests, ....}'
and ensure that Blocks
is not listed among the exclude
folders.