A library adding the timestamp type to Doctrine ORM

1.0 2018-02-24 17:38 UTC

This package is auto-updated.

Last update: 2020-07-24 21:53:19 UTC


Implementation of a timestamp type for the Doctrine DBAL

This library maps the DateTime PHP class to a Unix timestamp (integer) in the database.


Just add this to your composer.json

  "require": {
    "mmerian/doctrine-timestamp": "dev-master"

Then, when bootstraping your doctrine connection :

Type::addType('timestamp', 'DoctrineTimestamp\DBAL\Types\Timestamp');
$conn->getDatabasePlatform()->registerDoctrineTypeMapping('Timestamp', 'timestamp');