incompass / timestampable-bundle
Simple, efficient timestamps for symfony with doctrine
Installs: 40 756
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 10
Forks: 1
Type:symfony-bundle
Requires
- php: >=8.0
Requires (Dev)
- doctrine/doctrine-bundle: *
- doctrine/orm: *
- phpunit/phpunit: 9.*
- symfony/framework-bundle: 4.*
- symfony/yaml: ^5.0
README
TimestampableBundle
This bundle allows you to simply add use TimestampInterface
and use TimestampTrait
to a doctrine entity class to have
it automatically add created_at and updated_at fields and to
have them updated on insert and update.
Installation
Composer
composer require incompass/timestampable-bundle
Usage
Add the TimestampInterface to your doctrine entities.
class {Entity} implements TimestampInterface
Add the TimestampTrait trait to your doctrine entities.
use TimestampTrait
Update your database schema
php bin/console doctrine:schema:update --force
All entities will now be saved with created_at and updated_at fields populated.
Contributors
Joe Mizzi (casechek/incompass)