PHPackages                             coosos/jms-serializer-bidirectional-relation - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. coosos/jms-serializer-bidirectional-relation

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

coosos/jms-serializer-bidirectional-relation
============================================

Build mapping for restore bidirectional relation

v1.0.0(6y ago)0231MITPHPPHP ^7.2

Since Mar 15Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Coosos/JMSSerializerBidirectionalRelation)[ Packagist](https://packagist.org/packages/coosos/jms-serializer-bidirectional-relation)[ RSS](/packages/coosos-jms-serializer-bidirectional-relation/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (4)Versions (2)Used By (1)

JMS Serializer Bidirectional Relation
=====================================

[](#jms-serializer-bidirectional-relation)

Description
-----------

[](#description)

Build a mapping for restore bidirectional relation when deserialize process.

This mapping is add to your serialized content with `_mapping_bidirectional_relation` key.

Install
-------

[](#install)

### With jms/serializer (without symfony)

[](#with-jmsserializer-without-symfony)

```
use JMS\Serializer\SerializerBuilder;
use JMS\Serializer\EventDispatcher\EventDispatcher;
use Coosos\BidirectionalRelation\EventSubscriber\MapDeserializerSubscriber;
use Coosos\BidirectionalRelation\EventSubscriber\MapSerializerSubscriber;

$builder = SerializerBuilder::create();
$builder->configureListeners(function (EventDispatcher $dispatcher) {
    $dispatcher->addSubscriber(new MapSerializerSubscriber());
    $dispatcher->addSubscriber(new MapDeserializerSubscriber());
});

$serializer = $builder->build();
```

### With Symfony

[](#with-symfony)

```
# services.yml
Coosos\BidirectionalRelation\EventSubscriber\MapDeserializerSubscriber:
      tags:
        - { name: jms_serializer.event_subscriber }

Coosos\BidirectionalRelation\EventSubscriber\MapSerializerSubscriber:
      tags:
        - { name: jms_serializer.event_subscriber }
```

Usage
-----

[](#usage)

### Annotation (Minimum required)

[](#annotation-minimum-required)

For to avoid mapping on an object that does not need it, you should add `@Coosos\BidirectionalRelation\Annotations\SerializerBidirectionalRelation` to annotation class (only root model)

### Exclude from mapping

[](#exclude-from-mapping)

If you want to exclude an object to map, you can by adding `@Coosos\BidirectionalRelation\Annotations\ExcludeFromMapping` annotation to your field.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2246d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5632327?v=4)[Rémy Lescallier](/maintainers/Coosos)[@Coosos](https://github.com/Coosos)

---

Top Contributors

[![Coosos](https://avatars.githubusercontent.com/u/5632327?v=4)](https://github.com/Coosos "Coosos (10 commits)")

---

Tags

serializerjms-serializerbidirectional relation

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/coosos-jms-serializer-bidirectional-relation/health.svg)

```
[![Health](https://phpackages.com/badges/coosos-jms-serializer-bidirectional-relation/health.svg)](https://phpackages.com/packages/coosos-jms-serializer-bidirectional-relation)
```

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M226](/packages/masterminds-html5)[goetas-webservices/xsd2php-runtime

Convert XSD (XML Schema) definitions into PHP classes

4910.9M34](/packages/goetas-webservices-xsd2php-runtime)[jdesrosiers/silex-jms-serializer-provider

A silex service provider that integrates jms/serializer into silex

11126.3k2](/packages/jdesrosiers-silex-jms-serializer-provider)[goetas/xsd2php-runtime

Convert XSD (XML Schema) definitions into PHP classes

493.3k](/packages/goetas-xsd2php-runtime)

PHPackages © 2026

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