Sylius / SyliusResourceBundle

Simpler CRUD for Symfony applications
https://sylius.com
MIT License
219 stars 155 forks source link

[Repository] Impossible to use a repository that implements ServiceEntityRepositoryInterface #855

Open Nek- opened 7 months ago

Nek- commented 7 months ago

Sylius version affected: all

Description
It is possible to use a repository that inherits from ServiceEntityRepository but not a repository that "just" implements ServiceEntityRepositoryInterface. Besides it's useful when you already extends from some other base repository.

Steps to reproduce

  1. Create a repository that implements ServiceEntityRepositoryInterface
  2. Use it in the resource bundle config

Possible Solution

Check against the interface instead of the class.

https://github.com/Sylius/SyliusResourceBundle/blob/01132cb4646da060b573ba46ff8e22e21d064181/src/Bundle/DependencyInjection/Driver/Doctrine/DoctrineORMDriver.php#L74