Skip to content

php-arsenal/doctrine-odm-repository-service-compiler-pass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

doctrine-odm-repository-service-compiler-pass

Autoconfigure Doctrine ODM document repositories in Symfony as services to make them injectable into classes without the need to declare them in services.yaml.

composer require php-arsenal/doctrine-odm-repository-service-compiler-pass

Release CI Packagist

How to use?

Update your Kernel class to add this compiler pass.

use PhpArsenal\DoctrineODMRepositoryServiceCompilerPass\DocumentRepositoryAutoconfigureCompilerPass;

class Kernel extends BaseKernel
{
    use MicroKernelTrait;
    
    ...
    
    protected function build(ContainerBuilder $container): void
    {
        $container->addCompilerPass(new DocumentRepositoryAutoconfigureCompilerPass());
    }
    
    ...   
}

You can also reach defined document classes through parameter doctrine_mongodb.mongodb.odm.document_classes

About

Autoconfigure Doctrine ODM document repositories in Symfony as services

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages