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 1mo ago

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

18

—

LowBetter than 8% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity25

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

669d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e99a367536aa56d8009eecf1ef8dc87187baf4265a96f81beb9533878962d804?d=identicon)[martinax](/maintainers/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

[sylius/sylius

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

8.4k5.6M647](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M308](/packages/easycorp-easyadmin-bundle)[sulu/sulu

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

1.3k1.3M151](/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.3k](/packages/contao-core-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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