Skip to content

Commit

Permalink
Move tokenizer listeners to init method
Browse files Browse the repository at this point in the history
  • Loading branch information
msmakouz committed Dec 19, 2023
1 parent 32c6eda commit 75dfcaf
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/Bootloader/AnnotatedBootloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,20 @@ final class AnnotatedBootloader extends Bootloader
ListenerEmbeddingsLocator::class => ListenerEmbeddingsLocator::class,
];

public function init(SchemaBootloader $schema): void
{
$schema->addGenerator(SchemaBootloader::GROUP_INDEX, Annotated\Embeddings::class);
$schema->addGenerator(SchemaBootloader::GROUP_INDEX, Annotated\Entities::class);
$schema->addGenerator(SchemaBootloader::GROUP_INDEX, Annotated\TableInheritance::class);
$schema->addGenerator(SchemaBootloader::GROUP_INDEX, Annotated\MergeColumns::class);
$schema->addGenerator(SchemaBootloader::GROUP_RENDER, Annotated\MergeIndexes::class);
}

public function boot(
public function init(
SchemaBootloader $schema,
TokenizerListenerBootloader $tokenizer,
ListenerEntityLocator $entityLocator,
ListenerEmbeddingsLocator $embeddingsLocator
): void {
$tokenizer->addListener($entityLocator);
$tokenizer->addListener($embeddingsLocator);

$schema->addGenerator(SchemaBootloader::GROUP_INDEX, Annotated\Embeddings::class);
$schema->addGenerator(SchemaBootloader::GROUP_INDEX, Annotated\Entities::class);
$schema->addGenerator(SchemaBootloader::GROUP_INDEX, Annotated\TableInheritance::class);
$schema->addGenerator(SchemaBootloader::GROUP_INDEX, Annotated\MergeColumns::class);
$schema->addGenerator(SchemaBootloader::GROUP_RENDER, Annotated\MergeIndexes::class);
}

private function initEmbeddings(
Expand Down

0 comments on commit 75dfcaf

Please sign in to comment.