File tree Expand file tree Collapse file tree 1 file changed +21
-26
lines changed Expand file tree Collapse file tree 1 file changed +21
-26
lines changed Original file line number Diff line number Diff line change 99class GedmoExtensionsServiceProvider extends ServiceProvider
1010{
1111 /**
12- * Boot the service provider
12+ * Register the service provider.
13+ * @return void
1314 */
14- public function boot ()
15+ public function register ()
1516 {
16- $ registry = $ this ->app ->make ('registry ' );
17+ $ this ->app ['events ' ]->listen ('doctrine.extensions.booting ' , function () {
18+ $ registry = $ this ->app ->make ('registry ' );
1719
18- foreach ($ registry ->getManagers () as $ manager ) {
19- $ chain = $ manager ->getConfiguration ()->getMetadataDriverImpl ();
20- $ reader = $ chain ->getReader ();
20+ foreach ($ registry ->getManagers () as $ manager ) {
21+ $ chain = $ manager ->getConfiguration ()->getMetadataDriverImpl ();
22+ $ reader = $ chain ->getReader ();
2123
22- if ($ reader instanceof Reader) {
23- if ($ this ->app ->make ('config ' )->get ('doctrine.gedmo.all_mappings ' , false )) {
24- DoctrineExtensions::registerMappingIntoDriverChainORM (
25- $ chain ,
26- $ reader
27- );
28- } else {
29- DoctrineExtensions::registerAbstractMappingIntoDriverChainORM (
30- $ chain ,
31- $ reader
32- );
24+ if ($ reader instanceof Reader) {
25+ if ($ this ->app ->make ('config ' )->get ('doctrine.gedmo.all_mappings ' , false )) {
26+ DoctrineExtensions::registerMappingIntoDriverChainORM (
27+ $ chain ,
28+ $ reader
29+ );
30+ } else {
31+ DoctrineExtensions::registerAbstractMappingIntoDriverChainORM (
32+ $ chain ,
33+ $ reader
34+ );
35+ }
3336 }
3437 }
35- }
36- }
37-
38- /**
39- * Register the service provider.
40- * @return void
41- */
42- public function register ()
43- {
38+ });
4439 }
4540}
You can’t perform that action at this time.
0 commit comments