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

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

idetia/doctrine-extensions
==========================

Doctrine2 behavioral extensions

133PHP

Since Jun 25Pushed 12y ago1 watchersCompare

[ Source](https://github.com/idetia/DoctrineExtensions)[ Packagist](https://packagist.org/packages/idetia/doctrine-extensions)[ RSS](/packages/idetia-doctrine-extensions/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Doctrine2 behavioral extensions
===============================

[](#doctrine2-behavioral-extensions)

I'm looking for maintainers of this project
-------------------------------------------

[](#im-looking-for-maintainers-of-this-project)

Feel free to open discusion in issue or email message if you are interested in maintaining, refactoring doctrine2 extensions. The repository can be moved to the maintainers account and fork left on mine. I do not want users to lose availability of stable extensions which they were and are used to, at the moment.

**Version 2.3.6**

[![Build Status](https://camo.githubusercontent.com/356bfa7a02f2085920172e4f9c9b5101ff0e3c13d66d511eac83c70f20d70aa4/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6c3370703472642f446f637472696e65457874656e73696f6e732e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/l3pp4rd/DoctrineExtensions)

**Note:** recently doctrine orm and odm were updated to use common doctrine mapping persistense layer. The support for it has been made and tagged with **2.3.1** version tag. It will be compatible with latest version of doctrine mapping at master branches

### Latest updates

[](#latest-updates)

**2013-03-10**

- **Sluggable** added 'unique\_base' configuration parameter

**2013-03-05**

- A new extension - **References**, which links Entities in Documents and visa versa, [read more about it](https://github.com/l3pp4rd/DoctrineExtensions/blob/master/doc/references.md). It was contributed by @jwage, @avalanche123, @jmikola and @bobthecow, thanks

**2013-02-05**

- **Sluggable** added back slug handler mapping driver support for yaml and xml.

**2012-12-06**

- **Blameable** extension added to allow setting a username string or user object on fields, with the same options as Timestampable.

**2012-07-05**

- **Mapping** drivers were updated to support latest doctrine versions.

**2012-05-01**

- **Sluggable** now allows to regenerate slug if its set to empty or null. Also it allows to manually set the slug, in that case it would only transliterate it and ensure uniqueness.

### Summary and features

[](#summary-and-features)

This package contains extensions for Doctrine2 that hook into the facilities of Doctrine and offer new functionality or tools to use Doctrine2 more efficently. This package contains mostly used behaviors which can be easily attached to your event system of Doctrine2 and handle the records being flushed in the behavioral way. List of extensions:

- **Tree** - this extension automates the tree handling process and adds some tree specific functions on repository. (**closure**, **nestedset** or **materialized path**)
- **Translatable** - gives you a very handy solution for translating records into diferent languages. Easy to setup, easier to use.
- **Sluggable** - urlizes your specified fields into single unique slug
- **Timestampable** - updates date fields on create, update and even property change.
- **Blameable** - updates string or reference fields on create, update and even property change with a string or object (e.g. user).
- **Loggable** - helps tracking changes and history of objects, also supports version managment.
- **Sortable** - makes any document or entity sortable
- **Translator** - explicit way to handle translations
- **Softdeleteable** - allows to implicitly remove records
- **Uploadable** - provides file upload handling in entity fields
- **References** - supports linking Entities in Documents and visa versa

Currently these extensions support **Yaml**, **Annotation** and **Xml** mapping. Additional mapping drivers can be easily implemented using Mapping extension to handle the additional metadata mapping.

**Note:** Please note, that xml mapping needs to be in a different namespace, the declared namespace for Doctrine extensions is So root node now looks like this:

**Note:** Use 2.1.x tag in order to use extensions based on Doctrine2.1.x versions. Currently master branch is based on 2.2.x versions and may not work with 2.1.x

```

...

```

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

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

### ODM MongoDB support

[](#odm-mongodb-support)

List of extensions which support ODM

- Translatable
- Sluggable
- Timestampable
- Blameable
- Loggable
- Translator
- Tree (Materialized Path strategy for now)
- References

All these extensions can be nested together and mapped in traditional ways - annotations, xml or yaml

You can test these extensions on [my blog](http://gediminasm.org/demo "Test doctrine behavioral extensions"). All tutorials for basic usage examples are on [my blog](http://gediminasm.org "Tutorials for extensions") too. You can also fork or clone this blog from [github repository](https://github.com/l3pp4rd/gediminasm.org)

### Running the tests:

[](#running-the-tests)

PHPUnit 3.6 or newer is required. To setup and run tests follow these steps:

- go to the root directory of extensions
- download composer: **wget **
- install dev libraries: **php composer.phar install --dev**
- run: **phpunit -c tests**
- optional - run mongodb service if targetting mongo tests

### Running the example:

[](#running-the-example)

To setup and run example follow these steps:

- go to the root directory of extensions
- download composer: **wget **
- install dev libraries: **php composer.phar install --dev**
- edit **example/em.php** and configure your database on top of the file
- run: **./example/bin/console** or **php example/bin/console** for console commands
- run: **./example/bin/console orm:schema-tool:create** to create schema
- run: **php example/run.php** to run example

### Contributors:

[](#contributors)

Thanks to [everyone participating](http://github.com/l3pp4rd/DoctrineExtensions/contributors) in the development of these great Doctrine2 extensions!

And especialy ones who create and maintain new extensions:

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

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

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

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c61886cedd2a7e82180e832eafae9b34fab9ba51f5046ac7b5674b35c1160f4?d=identicon)[idetia](/maintainers/idetia)

---

Top Contributors

[![l3pp4rd](https://avatars.githubusercontent.com/u/132389?v=4)](https://github.com/l3pp4rd "l3pp4rd (575 commits)")[![comfortablynumb](https://avatars.githubusercontent.com/u/556188?v=4)](https://github.com/comfortablynumb "comfortablynumb (116 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (35 commits)")[![cevou](https://avatars.githubusercontent.com/u/1201681?v=4)](https://github.com/cevou "cevou (32 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)")[![mitrae](https://avatars.githubusercontent.com/u/1278440?v=4)](https://github.com/mitrae "mitrae (13 commits)")[![dbu](https://avatars.githubusercontent.com/u/76576?v=4)](https://github.com/dbu "dbu (13 commits)")[![everzet](https://avatars.githubusercontent.com/u/30813?v=4)](https://github.com/everzet "everzet (11 commits)")[![WesleyVanOpdorp](https://avatars.githubusercontent.com/u/3276853?v=4)](https://github.com/WesleyVanOpdorp "WesleyVanOpdorp (11 commits)")[![khepin](https://avatars.githubusercontent.com/u/455656?v=4)](https://github.com/khepin "khepin (9 commits)")[![mnapoli](https://avatars.githubusercontent.com/u/720328?v=4)](https://github.com/mnapoli "mnapoli (8 commits)")[![julesbou](https://avatars.githubusercontent.com/u/328303?v=4)](https://github.com/julesbou "julesbou (8 commits)")[![djlambert](https://avatars.githubusercontent.com/u/1187338?v=4)](https://github.com/djlambert "djlambert (7 commits)")[![idetia](https://avatars.githubusercontent.com/u/779872?v=4)](https://github.com/idetia "idetia (7 commits)")[![zhil](https://avatars.githubusercontent.com/u/981783?v=4)](https://github.com/zhil "zhil (6 commits)")[![jonathaningram](https://avatars.githubusercontent.com/u/626664?v=4)](https://github.com/jonathaningram "jonathaningram (6 commits)")[![jusurb](https://avatars.githubusercontent.com/u/171747?v=4)](https://github.com/jusurb "jusurb (6 commits)")[![mixegen](https://avatars.githubusercontent.com/u/1296286?v=4)](https://github.com/mixegen "mixegen (5 commits)")[![butt](https://avatars.githubusercontent.com/u/1155876?v=4)](https://github.com/butt "butt (5 commits)")

### Embed Badge

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

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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