mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 22:04:23 +00:00
28 lines
611 B
PHP
28 lines
611 B
PHP
<?php
|
|
|
|
namespace Chill\MainBundle\Doctrine\Type;
|
|
|
|
use Doctrine\DBAL\Types\DateIntervalType;
|
|
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
|
|
|
/**
|
|
* Re-declare the date interval to use the implementation of date interval in
|
|
* postgreql
|
|
*
|
|
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
|
*/
|
|
class NativeDateIntervalType extends DateIntervalType
|
|
{
|
|
|
|
public function getName(): string
|
|
{
|
|
return \Doctrine\DBAL\Types\Type::DATEINTERVAL;
|
|
}
|
|
|
|
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform): string
|
|
{
|
|
return 'INTERVAL';
|
|
}
|
|
|
|
}
|