PHPackages                             gedmo/doctrine-extensions - 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. gedmo/doctrine-extensions

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

gedmo/doctrine-extensions
=========================

Doctrine behavioral extensions

v3.22.0(5mo ago)4.1k118.8M—4.8%1.3k[41 issues](https://github.com/doctrine-extensions/DoctrineExtensions/issues)[38 PRs](https://github.com/doctrine-extensions/DoctrineExtensions/pulls)20MITPHPPHP ^7.4 || ^8.0CI passing

Since Jan 21Pushed 1mo ago79 watchersCompare

[ Source](https://github.com/doctrine-extensions/DoctrineExtensions)[ Packagist](https://packagist.org/packages/gedmo/doctrine-extensions)[ Docs](http://gediminasm.org/)[ GitHub Sponsors](https://github.com/l3pp4rd)[ GitHub Sponsors](https://github.com/mbabker)[ RSS](/packages/gedmo-doctrine-extensions/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (28)Versions (107)Used By (20)

Doctrine Behavioral Extensions
==============================

[](#doctrine-behavioral-extensions)

[![Continuous Integration](https://github.com/doctrine-extensions/DoctrineExtensions/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/doctrine-extensions/DoctrineExtensions/actions/workflows/continuous-integration.yml)[![Quality Assurance](https://github.com/doctrine-extensions/DoctrineExtensions/actions/workflows/qa.yml/badge.svg)](https://github.com/doctrine-extensions/DoctrineExtensions/actions/workflows/qa.yml)[![Coding Standards](https://github.com/doctrine-extensions/DoctrineExtensions/actions/workflows/coding-standards.yml/badge.svg)](https://github.com/doctrine-extensions/DoctrineExtensions/actions/workflows/coding-standards.yml)[![Latest Stable Version](https://camo.githubusercontent.com/caeda3289e2b92b29a6e5fcaa9cf5a80d59ddd6f0ef7c6090371c8938f6fa8ec/68747470733a2f2f706f7365722e707567782e6f72672f6765646d6f2f646f637472696e652d657874656e73696f6e732f76657273696f6e)](https://packagist.org/packages/gedmo/doctrine-extensions)

This package contains extensions for Doctrine ORM and MongoDB ODM that offer new functionality or tools to use Doctrine more efficiently. These behaviors can be easily attached to the event system of Doctrine and handle the records being flushed in a behavioral way.

---

Doctrine Extensions 3.0 Released 🎉
----------------------------------

[](#doctrine-extensions-30-released-tada)

3.0 focuses on refreshing this package for today's PHP. This includes:

- Bumping minimum version requirements of PHP, Doctrine, and other dependencies
- Implementing support for the latest Doctrine MongoDB &amp; Common packages
- Updating the test suite, add code and style standards, and other needed build tools
- Cleaning up documentation, code, comments, etc.

[Read the Upgrade Doc for more info.](/doc/upgrading/upgrade-v2.4-to-v3.0.md)

---

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

[](#installation)

```
composer require gedmo/doctrine-extensions

```

- [Symfony](/doc/frameworks/symfony.md)
- [Laravel](/doc/frameworks/laravel.md)
- [Laminas](/doc/frameworks/laminas.md)

### Upgrading

[](#upgrading)

- [From 2.4.x to 3.0](/doc/upgrading/upgrade-v2.4-to-v3.0.md)

Extensions
----------

[](#extensions)

#### ORM &amp; MongoDB ODM

[](#orm--mongodb-odm)

- [**Blameable**](/doc/blameable.md) - updates string or reference fields on create, update and even property change with a string or object (e.g. user).
- [**Loggable**](/doc/loggable.md) - helps tracking changes and history of objects, also supports version management.
- [**Sluggable**](/doc/sluggable.md) - urlizes your specified fields into single unique slug
- [**Timestampable**](/doc/timestampable.md) - updates date fields on create, update and even property change.
- [**Translatable**](/doc/translatable.md) - gives you a very handy solution for translating records into different languages. Easy to setup, easier to use.
- [**Tree**](/doc/tree.md) - automates the tree handling process and adds some tree-specific functions on repository. (**closure**, **nested set** or **materialized path**) *(MongoDB ODM only supports materialized path)*

#### ORM Only

[](#orm-only)

- [**IpTraceable**](/doc/ip_traceable.md) - inherited from Timestampable, sets IP address instead of timestamp
- [**SoftDeleteable**](/doc/soft-deleteable.md) - allows to implicitly remove records
- [**Sortable**](/doc/sortable.md) - makes any document or entity sortable
- [**Uploadable**](/doc/uploadable.md) - provides file upload handling in entity fields

#### MongoDB ODM Only

[](#mongodb-odm-only)

- [**References**](/doc/references.md) - supports linking Entities in Documents and vice versa
- [**ReferenceIntegrity**](/doc/reference_integrity.md) - constrains ODM MongoDB Document references

All extensions support **Attribute**, **XML** and **Annotation** (deprecated) mapping. Additional mapping drivers can be easily implemented using Mapping extension to handle the additional metadata mapping.

### Version Compatibility

[](#version-compatibility)

- DBAL: `^3.2` (for all the extensions) or `^4.0` (for all the extensions, except **Loggable**)
- ORM: `^2.14` or `^3.0`
- MongoDB ODM: `^2.3`

If you are setting up the Entity Manager without a framework, see the [example](/example/em.php) to prevent issues like #1310

### XML Mapping

[](#xml-mapping)

XML mapping needs to be in a different namespace, the declared namespace for Doctrine extensions is So root node now looks like this:

```

...

```

XML mapping xsd schemas are also versioned and can be used by version suffix:

- Latest version - ****
- 2.2.x version - ****
- 2.1.x version - ****

### Running Tests

[](#running-tests)

To set up and run the tests, follow these steps:

- Install [Docker](https://www.docker.com/) and ensure you have `docker compose`
- From the project root, run `docker compose up -d` to start containers in daemon mode
- Enter the container via `docker compose exec php bash` (you are now in the root directory: `/var/www`)
- Install Composer dependencies via `composer install`
- Run the tests: `vendor/bin/phpunit`

### Running the Example

[](#running-the-example)

To set up and run example, follow these steps:

- go to the root directory of extensions
- [download composer](https://getcomposer.org/download/)
- install dev libraries: `composer install`
- edit `example/em.php` and configure your database on top of the file
- run: `php example/bin/console` or `php example/bin/console` for console commands
- run: `php example/bin/console orm:schema-tool:create` to create the schema
- run: `php example/bin/console app:print-category-translation-tree` to run the example to print the category translation tree

### Contributors

[](#contributors)

Thanks to [everyone participating](https://github.com/doctrine-extensions/DoctrineExtensions/contributors) in the development of these great Doctrine extensions!

And especially ones who create and maintain new extensions:

- Lukas Botsch [lbotsch](https://github.com/lbotsch)
- Gustavo Adrian [comfortablynumb](https://github.com/comfortablynumb)
- Boussekeyt Jules [gordonslondon](https://github.com/gordonslondon)
- Kudryashov Konstantin [everzet](https://github.com/everzet)
- David Buchmann [dbu](https://github.com/dbu)

###  Health Score

80

—

ExcellentBetter than 100% of packages

Maintenance82

Actively maintained with recent releases

Popularity84

Widely adopted with strong download metrics

Community60

Healthy contributor diversity

Maturity85

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~53 days

Recently: every ~73 days

Total

96

Last Release

156d ago

Major Versions

v2.4.41 → v3.0.0-beta2020-08-21

v2.4.42 → v3.0.0-beta22020-08-27

v2.4.x-dev → v3.2.02021-10-05

PHP version history (5 changes)v2.2.0PHP &gt;=5.3.2

v3.0.0-beta2PHP ^7.2

v3.0.2PHP ^7.2 || ^8.0

v2.4.x-devPHP &gt;=5.3.2 &lt;8

v3.14.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b007520624bae09a9b2c11dc14b6c0f176b8d08456f84dcf3111a3a262ed29a?d=identicon)[l3pp4rd](/maintainers/l3pp4rd)

![](https://www.gravatar.com/avatar/d8ccc539bbd8e998d7430e3e3aaa57c0bdf11d34e8a7249630c5bdb600e96e2f?d=identicon)[cryode](/maintainers/cryode)

---

Top Contributors

[![l3pp4rd](https://avatars.githubusercontent.com/u/132389?v=4)](https://github.com/l3pp4rd "l3pp4rd (916 commits)")[![phansys](https://avatars.githubusercontent.com/u/1231441?v=4)](https://github.com/phansys "phansys (150 commits)")[![franmomu](https://avatars.githubusercontent.com/u/720690?v=4)](https://github.com/franmomu "franmomu (141 commits)")[![comfortablynumb](https://avatars.githubusercontent.com/u/556188?v=4)](https://github.com/comfortablynumb "comfortablynumb (116 commits)")[![AkenRoberts](https://avatars.githubusercontent.com/u/563886?v=4)](https://github.com/AkenRoberts "AkenRoberts (116 commits)")[![mbabker](https://avatars.githubusercontent.com/u/368545?v=4)](https://github.com/mbabker "mbabker (94 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (84 commits)")[![cevou](https://avatars.githubusercontent.com/u/1201681?v=4)](https://github.com/cevou "cevou (34 commits)")[![ejsidisi](https://avatars.githubusercontent.com/u/2768851?v=4)](https://github.com/ejsidisi "ejsidisi (26 commits)")[![lbotsch](https://avatars.githubusercontent.com/u/224285?v=4)](https://github.com/lbotsch "lbotsch (25 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (22 commits)")[![Alsatian67](https://avatars.githubusercontent.com/u/7631072?v=4)](https://github.com/Alsatian67 "Alsatian67 (17 commits)")[![dbu](https://avatars.githubusercontent.com/u/76576?v=4)](https://github.com/dbu "dbu (14 commits)")[![Slamdunk](https://avatars.githubusercontent.com/u/152236?v=4)](https://github.com/Slamdunk "Slamdunk (14 commits)")[![mitrae](https://avatars.githubusercontent.com/u/1278440?v=4)](https://github.com/mitrae "mitrae (13 commits)")[![WesleyVanOpdorp](https://avatars.githubusercontent.com/u/3276853?v=4)](https://github.com/WesleyVanOpdorp "WesleyVanOpdorp (11 commits)")[![everzet](https://avatars.githubusercontent.com/u/30813?v=4)](https://github.com/everzet "everzet (11 commits)")[![mnapoli](https://avatars.githubusercontent.com/u/720328?v=4)](https://github.com/mnapoli "mnapoli (11 commits)")[![birko](https://avatars.githubusercontent.com/u/1064302?v=4)](https://github.com/birko "birko (9 commits)")[![stephanvierkant](https://avatars.githubusercontent.com/u/601833?v=4)](https://github.com/stephanvierkant "stephanvierkant (9 commits)")

---

Tags

doctrinedoctrine-odm-mongodbdoctrine-ormnested-setsphpormdoctrinesortabletreeodmbehaviorsextensionsgedmosluggableloggabletranslatablenestedsettimestampableBlameableuploadable

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gedmo-doctrine-extensions/health.svg)

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

###  Alternatives

[stof/doctrine-extensions-bundle

Integration of the gedmo/doctrine-extensions with Symfony

1.9k85.3M381](/packages/stof-doctrine-extensions-bundle)[knplabs/doctrine-behaviors

Doctrine Behavior Traits

92212.7M64](/packages/knplabs-doctrine-behaviors)

PHPackages © 2026

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