Generators for Doctrine's hydrators and proxies.

v3.0.0 2019-10-03 06:41 UTC

This package is auto-updated.

Last update: 2020-05-03 08:15:12 UTC


Packagist Build Status Code Quality Code Coverage Downloads

olvlvl/doctrine-generators provides generators for Doctrine's hydrators and proxies.

You can use these generators to create the hydrators and proxies required by your application before building its artifact or container image, so it's ready to be used as soon as it's deployed.

Disclaimer: Only MongoDB documents are currently supported.


use Doctrine\ODM\MongoDB\Configuration;
use olvlvl\DoctrineGenerators\Document\HydratorGenerator;
use olvlvl\DoctrineGenerators\Document\ProxyGenerator;

/* @var string $cacheDir */

// An excerpt of the configuration used to create the document manager
$config = new Configuration();

/* @var \Doctrine\ODM\MongoDB\DocumentManager $dm */

$classes = (new HydratorGenerator)($dm);
$classes = (new ProxyGenerator)($dm);


The package requires PHP 7.2 or later.


The recommended way to install this package is through Composer:

$ composer require olvlvl/doctrine-generators


A container is available for local development. Enter the command make test-container to start the container and open a shell. The command make test runs the test suite. Alternatively the command make test-coverage runs the test suite and also creates an HTML coverage report in build/coverage. Dependencies are installed as required.

The package is continuously tested by Travis CI.

Build Status Code Coverage


olvlvl/doctrine-generators is licensed under the New BSD License - See the LICENSE file for details.