8000 bug #1477 [Turbo] simplify returning entity class name (jrushlow) · symfony/ux@6b6c57c · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b6c57c

Browse files
committed
bug #1477 [Turbo] simplify returning entity class name (jrushlow)
This PR was merged into the 2.x branch. Discussion ---------- [Turbo] simplify returning entity class name | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes/no <!-- please update src/**/CHANGELOG.md files --> | Issues | Fix # | License | MIT credit goes to nicolas, but alternate way to return the class name Commits ------- cded391 [Turbo] simplify returning entity class name
2 parents 9e086b1 + cded391 commit 6b6c57c

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/Turbo/src/Doctrine/ClassUtil.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,7 @@ final class ClassUtil
2222
public static function getEntityClass(object $entity): string
2323
{
2424
if ($entity instanceof LazyObjectInterface) {
25-
$entityClass = get_parent_class($entity);
26-
if (false === $entityClass) {
27-
throw new \LogicException('Parent class missing');
28-
}
29-
30-
return $entityClass;
25+
return get_parent_class($entity) ?: $entity::class;
3126
}
3227

3328
// @legacy for old versions of Doctrine

0 commit comments

Comments
 (0)
0