PHPackages                             ziiko10/doctrine-tracability-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. ziiko10/doctrine-tracability-bundle

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

ziiko10/doctrine-tracability-bundle
===================================

Trace all actions done on doctrine Entity

22PHP

Since Nov 6Pushed 5y ago2 watchersCompare

[ Source](https://github.com/ziiko10/doctrine-tracability-bundle)[ Packagist](https://packagist.org/packages/ziiko10/doctrine-tracability-bundle)[ RSS](/packages/ziiko10-doctrine-tracability-bundle/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

DoctrineTracabilityBundle
=========================

[](#doctrinetracabilitybundle)

This bundle allows to store changes made to a doctrine entity.

Actions enabled are :

##### 1) POST

[](#1--post)

##### 2) PUT

[](#2--put)

##### 3) DELETE

[](#3--delete)

### 1. Installation

[](#1-installation)

Add this to your `composer.json`

```
"minimum-stability": "dev"

```

And then install the bundle with `composer`:

```
$ composer require ziiko10/doctrine-tracability-bundle

```

### 2. Enable the bundle

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

To enable the bundle add this line to `bundles.php`:

```
\DctT\TracabilityBundle\DoctrineTracabilityBundle::class => ['all' => true],
```

### 3. Generate tracability entity :

[](#3-generate-tracability-entity-)

Generate the tracability entity in where we store the history system :

```
$  php bin/console doctrine:schema:update --force

```

The new tracability table will be like the following.

##### `doctrine`

[](#doctrine)

iduserresourceactiondone\_at1John DoeProduct-5DELETE2020-10-31 09:30:46### 4. Configure the bundle

[](#4-configure-the-bundle)

Let's say you have `Post` entity and you want to trace actions done on this entity.

First you need to decorate the entity with **@Tracable** annotation like bellow.

```
