Skip to content

eventjet/eventjet-psr-container-doctrine-odm

Repository files navigation

psr-container-doctrine-odm: Doctrine MongoDB ODM factories for PSR-11 containers

This package provides additional factories for Doctrine MongoDB ODM on top of roave/psr-container-doctrine to be used with containers using the PSR-11 standard.

Installation

$ composer require eventjet/psr-container-doctrine-odm

Configuration

The most basic way is just defining the factory for the DocumentManager. Everything else is taken from the configuration.

return [
    'dependencies' => [
        'factories' => [
           DocumentManager::class => DocumentManagerFactory::class,
        ],
    ],
];

Example Configuration

A full example of the configuration can be found in the examples folder.

The configuration style is heavily based on roave/psr-container-doctrine to retain the familiarity. Also, the configuration should be compatible with the 'DoctrineMongoODMModule for Laminas.