I'm trying to split one big service.yaml to few smaller files. In origin service.yaml I had
services:
_defaults:
autowire: true
autoconfigure: true
public: false
App\Domain\Country\Infrastructure\Repository\CountryRepository:
public: true
class: App\Domain\Country\Infrastructure\Repository\CountryRepository
factory: ["@doctrine.orm.default_entity_manager", getRepository]
arguments: [App\Domain\Country\Entity\Country]
Then I added import at the begining service.yam
imports:
- {resource: services/repositories.yaml}
repositories.yaml
services:
_defaults:
autowire: true
autoconfigure: true
public: true
App\Domain\Country\Infrastructure\Repository\CountryRepository:
factory: ["@doctrine.orm.default_entity_manager", getRepository]
arguments: [App\Domain\Country\Entity\Country]
After that I started to get error
Cannot autowire service "App\Domain\Country\Infrastructure\Repository\Count
ryRepository": argument "$class" of method "Doctrine\ORM\EntityRepository::
__construct()" references class "Doctrine\ORM\Mapping\ClassMetadata" but no
such service exists.
What's wrong there?
- https://pastebin.com/Uy85YJmc (service.yaml)
- https://pastebin.com/ZesAw3sD (repositories.yaml)