Skip to content

Support Symfony Doctrine Bridge #27

Closed
@curry684

Description

@curry684

In Symfony's Doctrine bridge you 'must' inject Doctrine via the Symfony\Bridge\Doctrine\RegistryInterface:

    /** @var UserRepository */
    private $userRepository;

    public function __construct(RegistryInterface $registry)
    {
        $this->userRepository = $registry->getRepository(User::class);
    }

This code fails however with:

Property xxx::$userRepository (xxx\UserRepository) does not accept Doctrine\Common\Persistence\ObjectRepository.

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