PHPackages                             mapado/doctrine-blender - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. mapado/doctrine-blender

AbandonedArchivedLibrary[Database &amp; ORM](/categories/database)

mapado/doctrine-blender
=======================

Package in charge of "blending" doctrine entities (ORM, ODM, etc.)

v0.6.0(11y ago)46.2k1MITPHP

Since Aug 28Pushed 10y ago5 watchersCompare

[ Source](https://github.com/mapado/doctrine-blender)[ Packagist](https://packagist.org/packages/mapado/doctrine-blender)[ RSS](/packages/mapado-doctrine-blender/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (9)Used By (1)

Doctrine Blender
================

[](#doctrine-blender)

[![Build Status](https://camo.githubusercontent.com/a28952b798978a0d9ba9de97c0a5f87c32ca2dfd34599f8abe528a38614cc73b/68747470733a2f2f7472617669732d63692e6f72672f6d617061646f2f646f637472696e652d626c656e6465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mapado/doctrine-blender)

This package makes it really simple to "blend" doctrine entities (ORM, ODM, etc.).

It is greatly inspired by the [Doctrine MongoDB ODM documentation](http://doctrine-mongodb-odm.readthedocs.org/en/latest/cookbook/blending-orm-and-mongodb-odm.html) on the subject.

Current status
--------------

[](#current-status)

It should work with every doctrine package. It is tested with Doctrine ORM and Doctrine MongoDB.

It also working with [mapado/elastica-query-bundle](https://github.com/mapado/elastica-query-bundle) in the ElasticSearch =&gt; Doctrine direction.

Installation
------------

[](#installation)

```
composer require "mapado/doctrine-blender:0.*"
```

Usage
-----

[](#usage)

### Mixing ORM Entity and ODM Document

[](#mixing-orm-entity-and-odm-document)

```
use Mapado\DoctrineBlender\ObjectBlender;
use Mapado\DoctrineBlender\ExternalAssociation;

$documentManager = ... // get a document manager
$entityManager = ... // get an entity manager

$eventSubscriber = new ObjectBlender;
$eventSubscriber->mapExternalAssociation(
    new ExternalAssociation(
        $entityManager,
        'Acme\Entity\Order',
        'product',
        $documentManager,
        'Acme\Document\Product',
        'getProductId', // optional, auto-generated with the property name
        'setProduct' // optional, auto-generated with the property name
    )
);
```

### Mixing ORM Entities living in different Entity Manager

[](#mixing-orm-entities-living-in-different-entity-manager)

It is really easy to mix ORM Entities as well:

```
use Mapado\DoctrineBlender\ObjectBlender;
use Mapado\DoctrineBlender\ExternalAssociation;

$entityManager = ... // get an entity manager
$secondEntityManager = ... // get the second manager

$eventSubscriber = new ObjectBlender;
$eventSubscriber->mapExternalAssociation(
    new ExternalAssociation(
        $entityManager,
        'Acme\Entity\Order',
        'product',
        $secondEntityManager,
        'Acme\Document\Product'
    )
);
```

Configuration
-------------

[](#configuration)

### Yaml

[](#yaml)

```
doctrine_external_association:
    client_address:         # this key is only for you
        source_object_manager_alias: product_em # an alias you will need to inject later
        classname: 'Entity\Product'
        property_name: 'product'
        reference_object_manager_alias: order_dm # another alia
        reference_class: 'Document\Order'
        reference_getter: 'getProductId'
        reference_setter: 'setProduct'
```

```
use Mapado\DoctrineBlender\Configuration\YamlConfiguration;

$ymlConf = new YamlConfiguration('/path/to/external_association.yml');

$entityManager = ... // get an entity manager
$documentManager = ... // get a document manager

$ymlConf->setObjectManagerReference('product_em', $entityManager)
    ->setObjectManagerReference('order_dm', $documentManager)
;
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

8

Last Release

4230d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3277986d0e1f93c7e8a58fdaf1b52e3f5a1588e73dfa298d33aafb1ebbde5ef2?d=identicon)[jdeniau](/maintainers/jdeniau)

![](https://www.gravatar.com/avatar/90d135128b469dc38fcf186ac78d0f2cd82fc696ffcf5be8a8c486b7bd911ff6?d=identicon)[mapado](/maintainers/mapado)

---

Top Contributors

[![jdeniau](https://avatars.githubusercontent.com/u/1398469?v=4)](https://github.com/jdeniau "jdeniau (28 commits)")[![johndodev](https://avatars.githubusercontent.com/u/2741956?v=4)](https://github.com/johndodev "johndodev (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mapado-doctrine-blender/health.svg)

```
[![Health](https://phpackages.com/badges/mapado-doctrine-blender/health.svg)](https://phpackages.com/packages/mapado-doctrine-blender)
```

###  Alternatives

[knplabs/doctrine-behaviors

Doctrine Behavior Traits

92212.7M64](/packages/knplabs-doctrine-behaviors)[fresh/doctrine-enum-bundle

Provides support of ENUM type for Doctrine2 in Symfony applications.

4636.8M12](/packages/fresh-doctrine-enum-bundle)[prezent/doctrine-translatable

Translatable behaviour extension for Doctrine

26754.3k5](/packages/prezent-doctrine-translatable)[doctrineencryptbundle/doctrine-encrypt-bundle

Encrypted symfony entity's by verified and standardized libraries

29415.1k](/packages/doctrineencryptbundle-doctrine-encrypt-bundle)[onurb/doctrine-yuml-bundle

Symfony Bundle to visualize the mapping of your entities with Yuml

4198.6k](/packages/onurb-doctrine-yuml-bundle)[portphp/doctrine

Doctrine ORM/ODM reader and writer for Port

13344.2k](/packages/portphp-doctrine)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
