PHPackages                             kerwanp/entity-change-watch-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. kerwanp/entity-change-watch-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

kerwanp/entity-change-watch-bundle
==================================

Allows you to listen to the life cycle of your entities

v2.6.0.x-dev(1y ago)01MITPHPPHP &gt;7.4

Since Jul 9Pushed 1y agoCompare

[ Source](https://github.com/kerwanp/EntityChangeWatchBundle)[ Packagist](https://packagist.org/packages/kerwanp/entity-change-watch-bundle)[ RSS](/packages/kerwanp-entity-change-watch-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (8)Versions (2)Used By (0)

EntityChangeWatchBundle
=======================

[](#entitychangewatchbundle)

[![travis build](https://camo.githubusercontent.com/b67ce1e5f5bdf5c0c8a1c14bf0028c8917864588aab1fe3866056eb3a4eee168/68747470733a2f2f7472617669732d63692e6f72672f61637469616e652f456e746974794368616e6765576174636842756e646c652e7376673f6272616e63683d76322e32)](https://travis-ci.org/actiane/EntityChangeWatchBundle)[![Coverage Status](https://camo.githubusercontent.com/0f5f5480f87bf09acfc1be7eec3b6e880ec9a406961eb8e562845db49c70f644/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f61637469616e652f456e746974794368616e6765576174636842756e646c652f62616467652e7376673f6272616e63683d76322e32)](https://coveralls.io/github/actiane/EntityChangeWatchBundle?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/7460fbf178fe5fe615721f1865015df125176550b3d024a2fe44faa0d1025a16/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61637469616e652f456e746974794368616e6765576174636842756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d76322e32)](https://scrutinizer-ci.com/g/actiane/EntityChangeWatchBundle/?branch=master)

This bundle allow to watch changes made on specific properties of entities using the doctrine2 life cycles events

INSTALLATION
------------

[](#installation)

Create a yaml file inside the packages directory

USAGE
-----

[](#usage)

### Examples

[](#examples)

```
entity_change_watch:
    classes:
        Entity\MyEntity:
            create:
                - {name: 'MyEntityService', method: 'doSomethingBeforeFlush', flush: false}
            delete:
                - {name: 'MyEntityService', method: 'doSomething'}
            update:
                all:
                    - {name: 'MyEntityService', method: 'doSomething'}
                properties:
                    property1:
                        - {name: 'MyEntityService', method: 'doSomething'}
                    property2:
                        - {name: 'MyEntityService', method: 'doSomethingElse'}
```

```
class MyEntityService
{
    public function doSomething(MyEntity $myEntity)
    {
        /*

        do something
        */
    }

    public function doSomethingBeforeFlush(MyEntity $myEntity)
    {
        /*

        do something before the flush
        */
    }

    public function doSomethingElse(MyEntity $myEntity, array $changedProperties, EntityManagerInterface $entityManager)
    {
        /*

        do something else
        */
    }
```

### Callbacks services definition

[](#callbacks-services-definition)

All callback services must be tagged with `actiane.entitychangewatch.callback`

### Callbacks method

[](#callbacks-method)

Please note that the orders of the arguments matter

The first argument is the entity The second argument $changedProperties contains an array with all the changes applied to the entity. The third argument $$entityManager is the entityManager

A callback is called after the flush, you can not execute another flush in this method.

If you whish to add or modify entities, you need to set the flush parameter to false

```
 - {name: 'MyEntityService', method: 'doSomethingBeforeFlush', flush: false}
```

If you create and persist a new entity in this callback, then calling EntityManager#persist() is not enough. You have to execute an additional call to `$unitOfWork->computeChangeSet($classMetadata, $entity).`

Changing primitive fields or associations requires you to explicitly trigger a re-computation of the changeset of the affected entity. This can be done by calling `$unitOfWork->recomputeSingleEntityChangeSet($classMetadata, $entity).`

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

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

724d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3766921?v=4)[martinax](/maintainers/martinax)[@MartinAX](https://github.com/MartinAX)

---

Top Contributors

[![emilien-puget](https://avatars.githubusercontent.com/u/4057108?v=4)](https://github.com/emilien-puget "emilien-puget (47 commits)")[![nicolas-anaxago](https://avatars.githubusercontent.com/u/36852013?v=4)](https://github.com/nicolas-anaxago "nicolas-anaxago (10 commits)")[![kerwanp](https://avatars.githubusercontent.com/u/36955373?v=4)](https://github.com/kerwanp "kerwanp (6 commits)")[![remijanot-anaxago](https://avatars.githubusercontent.com/u/55976672?v=4)](https://github.com/remijanot-anaxago "remijanot-anaxago (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kerwanp-entity-change-watch-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/kerwanp-entity-change-watch-bundle/health.svg)](https://phpackages.com/packages/kerwanp-entity-change-watch-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[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.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)[sylius/sylius

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

8.5k5.9M738](/packages/sylius-sylius)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[sulu/sulu

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

1.3k1.4M203](/packages/sulu-sulu)

PHPackages © 2026

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