PHPackages                             tiitoo/doctrine-audit-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. [Database &amp; ORM](/categories/database)
4. /
5. tiitoo/doctrine-audit-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

tiitoo/doctrine-audit-bundle
============================

Doctrine Audit Bundle

056PHP

Since Oct 5Pushed 3y ago1 watchersCompare

[ Source](https://github.com/TiiToo/auditor-bundle)[ Packagist](https://packagist.org/packages/tiitoo/doctrine-audit-bundle)[ RSS](/packages/tiitoo-doctrine-audit-bundle/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

DoctrineAuditBundle
===================

[](#doctrineauditbundle)

[![GitHub license](https://camo.githubusercontent.com/1d891072fdea9c9f0dfb5954a6a53650d18dd220c8d1e88b64f05cfd5fb29c7b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f44616d69656e4861727065722f446f637472696e65417564697442756e646c652e737667)](https://github.com/DamienHarper/DoctrineAuditBundle/blob/master/LICENSE)[![release-version-badge](https://camo.githubusercontent.com/c96f4433171f99267bde2cbbd3b2ba9e2e0e80bed7269cefb85969ce46d62625/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64616d69656e6861727065722f646f637472696e652d61756469742d62756e646c652e7376673f7374796c653d666c6174266c6162656c3d72656c65617365)](https://packagist.org/packages/damienharper/doctrine-audit-bundle)[![php-version-badge](https://camo.githubusercontent.com/cd00ba8db3b6401bfef7799754f85ce3e550b043a9fed84df54adc1363e55aab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f64616d69656e6861727065722f646f637472696e652d61756469742d62756e646c652e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/cd00ba8db3b6401bfef7799754f85ce3e550b043a9fed84df54adc1363e55aab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f64616d69656e6861727065722f646f637472696e652d61756469742d62756e646c652e7376673f7374796c653d666c6174)[![Downloads](https://camo.githubusercontent.com/576354c7b74c4e459ce10ff32988681f3f00e6154bcd6c54f9edc139ee0c6917/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64616d69656e6861727065722f646f637472696e652d61756469742d62756e646c652e737667)](https://packagist.org/packages/damienharper/doctrine-audit-bundle)

This bundle creates audit logs for all doctrine ORM database related changes:

- inserts and updates including their diffs and relation field diffs.
- many to many relation changes, association and dissociation actions.
- if there is an user in token storage, it is used to identify the user who made the changes.
- the audit entries are inserted within the same transaction during **flush**, if something fails the state remains clean.

Basically you can track any change from these log entries if they were managed through standard **ORM** operations.

**NOTE:** audit cannot track DQL or direct SQL updates or delete statement executions.

This bundle is inspired by [data-dog/audit-bundle](https://github.com/DATA-DOG/DataDogAuditBundle.git) and [simplethings/entity-audit-bundle](https://github.com/simplethings/EntityAuditBundle.git)

Installation
============

[](#installation)

Applications that use Symfony Flex
----------------------------------

[](#applications-that-use-symfony-flex)

Open a command console, enter your project directory and execute:

```
composer require damienharper/doctrine-audit-bundle
```

Applications that don't use Symfony Flex
----------------------------------------

[](#applications-that-dont-use-symfony-flex)

### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
composer require damienharper/doctrine-audit-bundle
```

This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `app/AppKernel.php` file of your project:

```
