popy-dev / doctrine-timestamp

Implementation of a timestamp type for the Doctrine DBAL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

doctrine-timestamp

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": {
    "mmerian/doctrine-timestamp": "dev-master"
  }
}

Then, when bootstraping your doctrine connection :

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

About

Implementation of a timestamp type for the Doctrine DBAL


Languages

Language:PHP 100.0%