Download the PHP package tourze/doctrine-timestamp-bundle without Composer
On this page you can find all versions of the php package tourze/doctrine-timestamp-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package doctrine-timestamp-bundle
Doctrine Timestamp Bundle
A Symfony bundle that automatically manages creation and update timestamps for Doctrine entities via PHP attributes.
Features
- Automatically sets creation timestamp on persist
- Automatically updates modification timestamp on update
- Supports both DateTime and Unix timestamp formats
- Configuration via PHP 8.1 attributes
- Zero configuration: just add attributes to your entity fields
- Compatible with Doctrine ORM and Symfony 6.4+
Installation
Requirements
- PHP >= 8.1
- Symfony >= 6.4
- doctrine/doctrine-bundle >= 2.13
Install via Composer
Quick Start
Add attributes to your entity
Types::datetime
: stores as DateTime object (default)Types::timestamp
: stores as Unix timestamp
No further configuration is needed. The bundle will automatically set these fields during persist and update events.
Documentation
Attributes
CreateTimeColumn
: Marks a property as the creation timestampUpdateTimeColumn
: Marks a property as the update timestamp- Both accept an optional
type
parameter:Types::datetime
orTypes::timestamp
Event Subscriber
- The bundle registers a Doctrine event subscriber (
TimeListener
) that listens toprePersist
andpreUpdate
events. - On entity creation, if the field is empty, sets the current time.
- On entity update, if the field is not manually changed, updates the time.
Advanced Usage
- You can use either
DateTime
orint
(timestamp) as your property type. - Works with property accessor for flexible entity property handling.
Contribution Guide
- Please submit issues and pull requests via GitHub.
- Code style: PSR-12
- Run tests and static analysis before submitting PRs.
- See CONTRIBUTING.md if available.
License
MIT License. See LICENSE for details.
Author
tourze https://github.com/tourze
Changelog
See CHANGELOG.md for version history and upgrade notes.
All versions of doctrine-timestamp-bundle with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
doctrine/dbal Version ^4.0
doctrine/doctrine-bundle Version ^2.13
doctrine/orm Version ^3.0
doctrine/persistence Version ^3.1 || ^4
monolog/monolog Version ^3.1
nesbot/carbon Version ^2.72 || ^3
psr/log Version ^3|^2|^1
symfony/config Version ^6.4
symfony/dependency-injection Version ^6.4
symfony/doctrine-bridge Version ^6.4
symfony/framework-bundle Version ^6.4
symfony/http-kernel Version ^6.4
symfony/property-access Version ^6.4
symfony/routing Version ^6.4
symfony/yaml Version ^6.4 || ^7.1
tourze/bundle-dependency Version 0.0.*
tourze/doctrine-entity-checker-bundle Version ~0.0.8
tourze/symfony-integration-test-kernel Version 0.0.*
doctrine/dbal Version ^4.0
doctrine/doctrine-bundle Version ^2.13
doctrine/orm Version ^3.0
doctrine/persistence Version ^3.1 || ^4
monolog/monolog Version ^3.1
nesbot/carbon Version ^2.72 || ^3
psr/log Version ^3|^2|^1
symfony/config Version ^6.4
symfony/dependency-injection Version ^6.4
symfony/doctrine-bridge Version ^6.4
symfony/framework-bundle Version ^6.4
symfony/http-kernel Version ^6.4
symfony/property-access Version ^6.4
symfony/routing Version ^6.4
symfony/yaml Version ^6.4 || ^7.1
tourze/bundle-dependency Version 0.0.*
tourze/doctrine-entity-checker-bundle Version ~0.0.8
tourze/symfony-integration-test-kernel Version 0.0.*
The package tourze/doctrine-timestamp-bundle contains the following files
Loading the files please wait ....