Skip to content

Commit 078d7a3

Browse files
chore: update readme
1 parent 663c516 commit 078d7a3

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

README.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ Enable the bundle by adding it to the list of registered bundles in ```config/bu
2323
<?php
2424
2525
return [
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\PostgresSchemaBundle\Doctrine\SchemaConnection;
50+
use Macpaw\SchemaContextBundle\Service\SchemaResolver;
51+
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
52+
use Symfony\Component\HttpKernel\Kernel 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+
4471
Make sure you configure the context bundle properly:
4572

4673
See https://github.com/MacPaw/schema-context-bundle/blob/develop/README.md

0 commit comments

Comments
 (0)