From 078d7a3aaccb05e4f173f5e88fbcfc38124e2af6 Mon Sep 17 00:00:00 2001 From: Aleksey Tupichenkov Date: Thu, 28 Aug 2025 09:29:10 +0300 Subject: [PATCH] chore: update readme --- README.md | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 502c9da..6f211ea 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,10 @@ Enable the bundle by adding it to the list of registered bundles in ```config/bu ['all' => true], - Macpaw\SchemaContextBundle\PostgresSchemaBundle::class => ['all' => true], - // ... - ]; + // ... + Macpaw\SchemaContextBundle\SchemaContextBundle::class => ['all' => true], + Macpaw\SchemaContextBundle\PostgresSchemaBundle::class => ['all' => true], +]; ``` ## Configuration @@ -41,6 +41,33 @@ doctrine: default: wrapper_class: Macpaw\PostgresSchemaBundle\Doctrine\SchemaConnection ``` + +Set `SchemaResolver` to `SchemaConnection` at kernel boot +```php +# src/Kernel.php + +use Macpaw\PostgresSchemaBundle\Doctrine\SchemaConnection; +use Macpaw\SchemaContextBundle\Service\SchemaResolver; +use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; +use Symfony\Component\HttpKernel\Kernel as BaseKernel; + +class Kernel extends BaseKernel +{ + use MicroKernelTrait; + + public function boot(): void + { + parent::boot(); + + SchemaConnection::setSchemaResolver( + $this->getContainer()->get(SchemaResolver::class), + ); + } + + // ... +} +``` + Make sure you configure the context bundle properly: See https://github.com/MacPaw/schema-context-bundle/blob/develop/README.md