Skip to content

Commit 153b093

Browse files
committed
Fix issue related to usage of manual loading of annotations
Gedmo uses the AnnotationRegistry::registerFile which toggles the bool AnnotationRegistry$registerFileUsed. This causes AnnotationRegistry::loadAnnotationClass() to go into a mode where it expects all annotations to be loaded in a different manner, and not autoloaded. This behaviour from Gedmo was changed here doctrine-extensions/DoctrineExtensions#2558 Adding this custom loader makes the annotation registry "autoloadable".
1 parent 84941b4 commit 153b093

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/GedmoExtensionsServiceProvider.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace LaravelDoctrine\Extensions;
44

5+
use Doctrine\Common\Annotations\AnnotationRegistry;
56
use Doctrine\Persistence\Mapping\Driver\MappingDriverChain;
67
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
78
use Gedmo\DoctrineExtensions;
@@ -80,6 +81,8 @@ private function registerGedmoForAnnotations(MappingDriverChain $chain)
8081
$chain->getReader()
8182
);
8283
}
84+
85+
AnnotationRegistry::registerUniqueLoader('class_exists');
8386
}
8487

8588
/**

0 commit comments

Comments
 (0)