Sylius / SyliusResourceBundle

Simpler CRUD for Symfony applications

Home Page:https://sylius.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Repository] Impossible to use a repository that implements ServiceEntityRepositoryInterface

Nek- opened this issue · comments

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.

if (is_a($repositoryClass, ServiceEntityRepository::class, true)) {