PHPackages                             steevanb/doctrine-events - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. steevanb/doctrine-events

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

steevanb/doctrine-events
========================

Add Doctrine events

1.2.0(9y ago)02.4k2MITPHP ^5.4.6 || ^7.0

Since Dec 14Compare

[ Source](https://github.com/steevanb/doctrine-events)[ Packagist](https://packagist.org/packages/steevanb/doctrine-events)[ RSS](/packages/steevanb-doctrine-events/feed)WikiDiscussions Synced today

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

[![version](https://camo.githubusercontent.com/1dd20ab7897e2afa95b7178fe0467c6d03503bfdea3890055c130775e1e12275/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e322e302d677265656e2e737667)](https://github.com/steevanb/doctrine-events/tree/1.2.0)[![doctrine](https://camo.githubusercontent.com/600fd33c6d1b24dcd8f133d154a65ddd821d8a7491cd4a7177d9b85a3fae62b8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f637472696e652f6f726d2d253545322e352e302d626c75652e737667)](http://www.doctrine-project.org)[![php](https://camo.githubusercontent.com/18a177e74e5884307d10edd222e5d5c7b48af5e08c1051ecba0e2cb45cb35fab/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545352e342e36253230253743253743253230253545372e302d626c75652e737667)](http://www.php.net)[![Lines](https://camo.githubusercontent.com/21525c1d9fb2b3c431ed1e22851db595eca24f47c91227a2a0b12d66268930df/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532306c696e65732d313531322d677265656e2e737667)](https://camo.githubusercontent.com/21525c1d9fb2b3c431ed1e22851db595eca24f47c91227a2a0b12d66268930df/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532306c696e65732d313531322d677265656e2e737667)[![Total Downloads](https://camo.githubusercontent.com/cbf6fffc2d30d6c432eb30b72656cead0c5d843fc128feced8a99cab4e5c0edc/68747470733a2f2f706f7365722e707567782e6f72672f7374656576616e622f646f637472696e652d6576656e74732f646f776e6c6f616473)](https://camo.githubusercontent.com/cbf6fffc2d30d6c432eb30b72656cead0c5d843fc128feced8a99cab4e5c0edc/68747470733a2f2f706f7365722e707567782e6f72672f7374656576616e622f646f637472696e652d6576656e74732f646f776e6c6f616473)[![SensionLabsInsight](https://camo.githubusercontent.com/1a9e6d5b7dd95256b6ecaa08a3205764e1d3ac558c457239b9db6fdc15f6ead5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53656e73696f6e4c616273496e73696768742d706c6174696e756d2d627269676874677265656e2e737667)](https://insight.sensiolabs.com/projects/c0ecb586-f4b3-472d-8202-e2e2a6a2f474/analyses/8)[![Scrutinizer](https://camo.githubusercontent.com/3cae75dd3d7e410e039fa87e3d42e2fa4cf8281894df65e96cf4686ccd7bb42f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7374656576616e622f646f637472696e652d6576656e74732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/steevanb/doctrine-events/)

doctrine-events
---------------

[](#doctrine-events)

Add some events to Doctrine 2.5

Fix a Doctrine UnitOfwork bug with extraUpdates, who are not removed when you add and remove your entity before calling flush()

[Changelog](changelog.md)

onCreateEntityOverrideLocalValues
---------------------------------

[](#oncreateentityoverridelocalvalues)

Dispatched when UnitOfWork try to know if current entity must be filled with values retrieved from query, or if this entity is already known and fields are already defined.

onCreateEntityDefineFieldValues
-------------------------------

[](#oncreateentitydefinefieldvalues)

Dispactched when UnitOfWork define entity field values

onNewEntityInstance
-------------------

[](#onnewentityinstance)

Dispactched when UnitOfWork create new instance of your Entity

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

[](#installation)

Add it to your composer.json :

```
{
    "require": {
        "steevanb/doctrine-events": "^1.2",
    }
}
```

You have to use steevanb\\DoctrineEvents\\Doctrine\\ORM\\EntityManager instead of Doctrine\\ORM\\EntityManager

Internally, it will use steevanb\\DoctrineEvents\\Doctrine\\ORM\\UnitOfWork instead of Doctrine\\ORM\\UnitOfWork

If you are on Symfony2 or Symfony3 project, you can add it to your config :

```
# app/config.yml
parameters:
    doctrine.orm.entity_manager.class: steevanb\DoctrineEvents\Doctrine\ORM\EntityManager
```

Some lib who use it
-------------------

[](#some-lib-who-use-it)

 : add MERGE\_ENTITY hint to define fields loaded with multiple queries, with PARTIAL, instead of returning first hydrated entity

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

5

Last Release

3422d ago

### Community

Maintainers

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

### Embed Badge

![Health badge](/badges/steevanb-doctrine-events/health.svg)

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

###  Alternatives

[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

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