moln / doctrine-timestamp
A library adding the timestamp type to Doctrine ORM
1.1.0
2022-07-15 02:31 UTC
Requires
- php: >=5.5.0
- doctrine/dbal: 2.* | ^3.0
Requires (Dev)
- phpunit/phpunit: ^5.7
This package is auto-updated.
Last update: 2024-11-15 07:16:30 UTC
README
Implementation of a timestamp type for the Doctrine DBAL
This library maps the DateTime PHP class to a Unix timestamp (integer) in the database.
Installation
Just add this to your composer.json
composer require moln/doctrine-timestamp
Then, when bootstraping your doctrine connection :
Type::addType('timestamp', 'DoctrineTimestamp\DBAL\Types\Timestamp'); $conn->getDatabasePlatform()->registerDoctrineTypeMapping('Timestamp', 'timestamp');