File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \UX \Turbo \Doctrine ;
13
13
14
- use Doctrine \Common \Util \ClassUtils as LegacyClassUtils ;
15
14
use Symfony \Component \VarExporter \LazyObjectInterface ;
16
15
17
16
/**
@@ -24,13 +23,13 @@ final class ClassUtil
24
23
*/
25
24
public static function getEntityClass (object $ entity ): string
26
25
{
27
- if ($ entity instanceof LazyObjectInterface) {
28
- return get_parent_class ($ entity ) ?: $ entity ::class;
26
+ // Doctrine proxies (old versions)
27
+ if (str_contains ($ entity ::class, 'Proxies \\__CG__ ' )) {
28
+ return get_parent_class ($ entity );
29
29
}
30
30
31
- // @legacy for old versions of Doctrine
32
- if (class_exists (LegacyClassUtils::class)) {
33
- return LegacyClassUtils::getClass ($ entity );
31
+ if ($ entity instanceof LazyObjectInterface) {
32
+ return get_parent_class ($ entity ) ?: $ entity ::class;
34
33
}
35
34
36
35
return $ entity ::class;
You can’t perform that action at this time.
0 commit comments