Download the PHP package zhortein/doctrine-lifecycle-bundle without Composer

On this page you can find all versions of the php package zhortein/doctrine-lifecycle-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package 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:

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


Features

Timestampable

Automatic handling of:

Blameable

Automatic handling of:

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

Doctrine integration

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

UTC timestamps

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


Current Scope

This bundle focuses only on entity lifecycle metadata.

It does not try to handle:

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


Requirements


Installation

Composer

Bundle registration

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


Default Behavior

Timestampable

On prePersist:

On preUpdate:

Blameable

On prePersist:

On preUpdate:

If no actor can be resolved, blameable fields remain unchanged.


Usage

Timestampable

1. Implement the interface and use the trait

2. Result

The bundle will automatically maintain:


Blameable

1. Implement the interface and use the trait

2. Result

The bundle will automatically maintain:

These values are provided by an ActorResolverInterface.


Timestampable + Blameable together

A single entity can use both features:


Actor Resolver

The bundle relies on the following contract:

By default, the bundle provides a null resolver, which means blameable fields remain null unless you override the service.


Using Symfony Security as actor resolver

In most applications, you will want to resolve the actor identifier from the authenticated user.

Example:

Then override the resolver binding in your application:


Notes about timestamps

This bundle stores lifecycle timestamps as:

This is intentional.

The bundle handles technical lifecycle timestamps, not application-level timezone presentation.
If your application needs to display dates in a specific timezone, convert them at application level.

Example:


Philosophy

This bundle intentionally follows a few rules:


Development Status

The bundle is already usable for:

Additional lifecycle helpers may come later, but only if they remain aligned with the bundle's narrow scope.


Roadmap

Possible future additions:


Quality Assurance

This bundle includes:

Typical local commands:


Testing locally with a path repository

When developing the bundle alongside a Symfony project, you can use a Composer path repository in the host application:

This allows you to test the bundle directly in a real application without publishing it first.


License

This bundle is released under the MIT License.


All versions of doctrine-lifecycle-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
doctrine/doctrine-bundle Version ^2.12||^3.0
doctrine/orm Version ^3.3
doctrine/persistence Version ^3.3 || ^4.0
symfony/config Version ^7.4 || ^8.0
symfony/dependency-injection Version ^7.4 || ^8.0
symfony/framework-bundle Version ^7.4 || ^8.0
symfony/http-kernel Version ^7.4 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zhortein/doctrine-lifecycle-bundle contains the following files

Loading the files please wait ...