asiviero/doctrine-timestamp

A library adding the timestamp type to Doctrine ORM

Installs: 1 447

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 12

pkg:composer/asiviero/doctrine-timestamp

v0.1.2 2019-01-17 20:53 UTC

This package is not auto-updated.

Last update: 2025-12-28 11:40:52 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

{
  "require": {
    "asiviero/doctrine-timestamp": "dev-master"
  }
}

Then, when bootstraping your doctrine connection :

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