File tree Expand file tree Collapse file tree 1 file changed +31
-4
lines changed Expand file tree Collapse file tree 1 file changed +31
-4
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,10 @@ Enable the bundle by adding it to the list of registered bundles in ```config/bu
2323<?php
2424
2525return [
26- Macpaw\SchemaContextBundle\SchemaContextBundle::class => ['all' => true],
27- Macpaw\SchemaContextBundle\PostgresSchemaBundle ::class => ['all' => true],
28- // ...
29- ];
26+ // ...
27+ Macpaw\SchemaContextBundle\SchemaContextBundle ::class => ['all' => true],
28+ Macpaw\SchemaContextBundle\PostgresSchemaBundle::class => ['all' => true],
29+ ];
3030```
3131
3232## Configuration
@@ -41,6 +41,33 @@ doctrine:
4141 default :
4242 wrapper_class : Macpaw\PostgresSchemaBundle\Doctrine\SchemaConnection
4343` ` `
44+
45+ Set ` SchemaResolver` to `SchemaConnection` at kernel boot
46+ ` ` ` php
47+ # src/Kernel.php
48+
49+ use Macpaw\P ostgresSchemaBundle\D octrine\S chemaConnection;
50+ use Macpaw\S chemaContextBundle\S ervice\S chemaResolver;
51+ use Symfony\B undle\F rameworkBundle\K ernel\M icroKernelTrait;
52+ use Symfony\C omponent\H ttpKernel\K ernel as BaseKernel;
53+
54+ class Kernel extends BaseKernel
55+ {
56+ use MicroKernelTrait;
57+
58+ public function boot(): void
59+ {
60+ parent::boot();
61+
62+ SchemaConnection::setSchemaResolver(
63+ $this->getContainer()->get(SchemaResolver::class),
64+ );
65+ }
66+
67+ // ...
68+ }
69+ ` ` `
70+
4471Make sure you configure the context bundle properly :
4572
4673See https://github.com/MacPaw/schema-context-bundle/blob/develop/README.md
You can’t perform that action at this time.
0 commit comments