PHPackages                             alengo/doctrine-compatibility-bundle - 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. alengo/doctrine-compatibility-bundle

ActiveSymfony-bundle

alengo/doctrine-compatibility-bundle
====================================

Compatibility fixes for Sulu 3 with Doctrine ORM 3.x and Gedmo DoctrineExtensions

1.0.1(1mo ago)04↑2150%MITPHPPHP ^8.2

Since Apr 5Pushed 1mo agoCompare

[ Source](https://github.com/alengodev/SuluDoctrineCompatibilityBundle)[ Packagist](https://packagist.org/packages/alengo/doctrine-compatibility-bundle)[ Docs](https://github.com/alengodev/SuluDoctrineCompatibilityBundle)[ RSS](/packages/alengo-doctrine-compatibility-bundle/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (4)Used By (0)

SuluDoctrineCompatibilityBundle
===============================

[](#suludoctrinecompatibilitybundle)

A Symfony bundle that fixes runtime incompatibilities between **Sulu 3**, **Doctrine ORM 3.x**, and **Gedmo DoctrineExtensions**.

The Problem
-----------

[](#the-problem)

Sulu 3, Doctrine ORM 3.x, and Gedmo DoctrineExtensions all underwent major version changes around the same time. The combination of these three libraries produces three distinct bugs that surface at runtime.

**1. Gedmo TreeListener fails for Sulu's Page entity**

`Sulu\Page\Domain\Model\Page` is declared as a `` in Sulu's ORM XML. Gedmo's `ExtensionMetadataFactory` explicitly returns `[]` for mapped-superclasses, so any call to `getConfiguration()` or `getStrategy()` with `SuluPage::class` throws:

```
UnexpectedValueException: Tree object class: Sulu\Page\Domain\Model\Page must have tree metadata at this point

```

**2. Gedmo TreeObjectHydrator fails with Doctrine ORM 3.x**

Doctrine ORM 3.x removed the `mappedBy` property from owning-side `ManyToOneAssociationMapping`. Gedmo's hydrator unconditionally accesses it for all associations, throwing:

```
Error: Unknown property "mappedBy" on class Doctrine\ORM\Mapping\ManyToOneAssociationMapping

```

**3. Inherited association mappings missing `declared` property**

When extending Sulu's Page or Article entities with Doctrine ORM 3.x and `report_fields_where_declared: true`, inherited association mappings have `null` as their `declared` property, causing schema validation errors.

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

[](#installation)

```
composer require alengo/doctrine-compatibility-bundle
```

The bundle registers itself automatically via Symfony Flex.

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

[](#configuration)

The default configuration works for standard Sulu projects where the concrete Page entity is `App\Entity\Page`. To override:

```
# config/packages/alengo_doctrine_compatibility.yaml
alengo_doctrine_compatibility:
    page_entity_class: App\Entity\Page  # adjust if your class differs
```

The configured class must extend `Sulu\Page\Domain\Model\Page`.

How It Works
------------

[](#how-it-works)

### `SuluPageAwareTreeListener`

[](#sulupageawaretreelistener)

Extends Gedmo's `TreeListener` and overrides `getConfiguration()` and `getStrategy()`. Any call with `Sulu\Page\Domain\Model\Page` is transparently delegated to the configured concrete Page entity class, which has valid tree metadata.

Registered via `CompilerPass` — overrides the `stof_doctrine_extensions.listener.tree` service after all bundle extensions have loaded, ensuring correct behavior regardless of bundle registration order.

### `SafeTreeObjectHydrator`

[](#safetreeobjecthydrator)

Extends Gedmo's `TreeObjectHydrator` and overrides `getChildrenField()` to skip owning-side `ManyToOne` associations before accessing `mappedBy`, which does not exist in Doctrine ORM 3.x for owning-side mappings.

Registered as the `sulu_page_tree` hydrator via `CompilerPass`, overriding Sulu's default registration across all configured entity managers.

### `InheritedAssociationDeclaredFixerSubscriber`

[](#inheritedassociationdeclaredfixersubscriber)

Listens to Doctrine's `loadClassMetadata` event and resolves the `declared` property for inherited association mappings where it is `null`, by walking the class hierarchy via reflection.

Requirements
------------

[](#requirements)

PackageVersionPHP`^8.2`Sulu`^3.0`Doctrine ORM`^3.0`Gedmo DoctrineExtensions`^3.0`stof/doctrine-extensions-bundle`^1.11`Symfony`^7.0`License
-------

[](#license)

MIT — [alengo.dev](https://alengo.dev)

###  Health Score

39

—

LowBetter than 87% of packages

Maintenance90

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

Every ~0 days

Total

3

Last Release

45d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a3bea97975bdeddcfa5b76c222740e703e4ff5f9bbf5f6d5d75e8827e0a48ac?d=identicon)[alengodev](/maintainers/alengodev)

---

Top Contributors

[![hual7](https://avatars.githubusercontent.com/u/89628357?v=4)](https://github.com/hual7 "hual7 (6 commits)")

### Embed Badge

![Health badge](/badges/alengo-doctrine-compatibility-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/alengo-doctrine-compatibility-bundle/health.svg)](https://phpackages.com/packages/alengo-doctrine-compatibility-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[sulu/headless-bundle

Bundle that provides controllers and services for using Sulu as headless content management system

55133.7k2](/packages/sulu-headless-bundle)

PHPackages © 2026

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