Skip to content

EntityManager Service Auto Wiring #17850

Closed
@Seb33300

Description

@Seb33300

Hi,

I am trying to use the new auto wiring feature to automatically load the entity manager to my service:

my_test_service.test:
      class: MyTestBundle\Service\TestService
      autowire: true
use Doctrine\ORM\EntityManager;
class TestService
{
    public function __construct(EntityManager $em)
    {
    }
}

Result is:

RuntimeException in AutowirePass.php line 231: Unable to autowire argument
of type "Doctrine\ORM\EntityManager" for the service "my_test_service.test".

Any idea?

Thanks

Seb

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions