Skip to content

Cannot autowire service for repository #1956

@lektura0bandyta

Description

@lektura0bandyta

Hi,

I've created UserRepository and correctly declared repository class in fos_elastica.yaml as it is in https://github.com/FriendsOfSymfony/FOSElasticaBundle/blob/master/doc/cookbook/custom-repositories.md but symfony cannot autowire service.

I'm getting error like this:

Cannot autowire service "App\ElasticRepository\UserRepository": argument "$finder" of method 
"FOS\ElasticaBundle\Repository::__construct()" references interface 
"FOS\ElasticaBundle\Finder\PaginatedFinderInterface" but no such service exists. 
You should maybe alias this interface to one of these existing services: "fos_elastica.finder.user", "fos_elastica.finder.city".

Does any one know why it won't works?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions