marktopper / doctrine-dbal-timestamp-type by fletch3555

Add the timestamp type for Doctrine/DBAL
89,726
29
1
Package Data
Maintainer Username: fletch3555
Package Create Date: 2016-11-24
Package Last Update: 2018-11-11
Language: PHP
License: MIT
Last Refreshed: 2019-07-19 15:05:36
Package Statistics
Total Downloads: 89,726
Monthly Downloads: 5,324
Daily Downloads: 212
Total Stars: 29
Total Watchers: 1
Total Forks: 5
Total Open Issues: 1

Doctrine/DBAL Timestamp Type

Since Doctrine/DBAL does not support the MySQL Timestamp type, you might want to add it on your own using this package.

Why using this?

According to this issue, Doctrine/DBAL does not support MySQL-specific database types like this one. Therefor we must add it ourself.

Installation

composer require marktopper/doctrine-dbal-timestamp-type

Then add the type to Doctrine\DBAL:

\Doctrine\DBAL\Types\Type::addType('timestamp', 'MarkTopper\DoctrineDBALTimestampType\TimestampType');

Laravel 5

You can use the Laravel Provider to ensure that the type is added to Doctrine\DBAL by adding the following to providers:

MarkTopper\DoctrineDBALTimestampType\Laravel5ServiceProvider::class,