PHPackages                             zhortein/doctrine-lifecycle-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. zhortein/doctrine-lifecycle-bundle

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

zhortein/doctrine-lifecycle-bundle
==================================

Reusable Doctrine lifecycle features for Symfony entities, including timestampable and blameable support.

0.1.3(1mo ago)15MITPHPPHP ^8.4CI passing

Since Apr 19Pushed 1mo agoCompare

[ Source](https://github.com/Zhortein/doctrine-lifecycle-bundle)[ Packagist](https://packagist.org/packages/zhortein/doctrine-lifecycle-bundle)[ Docs](https://github.com/Zhortein/doctrine-lifecycle-bundle)[ RSS](/packages/zhortein-doctrine-lifecycle-bundle/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (4)Dependencies (15)Versions (6)Used By (0)

Zhortein Doctrine Lifecycle Bundle
==================================

[](#zhortein-doctrine-lifecycle-bundle)

Reusable Doctrine lifecycle features for Symfony entities.

This bundle provides a clean and focused foundation for common entity lifecycle concerns in Symfony applications using Doctrine ORM.

It currently includes:

- **Timestampable** support
- **Blameable** support
- Doctrine lifecycle listeners based on attributes
- UTC-based lifecycle timestamps

The bundle is designed to stay small, explicit and reusable.

---

Features
--------

[](#features)

### Timestampable

[](#timestampable)

Automatic handling of:

- `createdAt`
- `updatedAt`

### Blameable

[](#blameable)

Automatic handling of:

- `createdByIdentifier`
- `updatedByIdentifier`

Blameable values are stored as scalar identifiers, which keeps the bundle generic and independent from any application-specific `User` entity.

### Doctrine integration

[](#doctrine-integration)

The bundle uses Doctrine listeners to update lifecycle fields automatically on:

- `prePersist`
- `preUpdate`

### UTC timestamps

[](#utc-timestamps)

Lifecycle dates are generated in **UTC** to provide predictable and consistent storage across applications.

---

Current Scope
-------------

[](#current-scope)

This bundle focuses only on **entity lifecycle metadata**.

It does **not** try to handle:

- audit trail history
- workflow/state machines
- publication systems
- translations
- business-specific ownership models

If you need full audit logging, use a dedicated audit bundle alongside this one.

---

Requirements
------------

[](#requirements)

- PHP **8.4+**
- Symfony **7.4** or **8.0**
- Doctrine Bundle
- Doctrine ORM

---

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

[](#installation)

### Composer

[](#composer)

```
composer require zhortein/doctrine-lifecycle-bundle
```

### Bundle registration

[](#bundle-registration)

If Symfony Flex does not register the bundle automatically, add it manually in `config/bundles.php`:

```
