From b521b494029f6a90d872580061b9881f52b408ef Mon Sep 17 00:00:00 2001 From: beberlei Date: Sat, 16 Jan 2010 08:52:58 +0000 Subject: [PATCH] DDC-179 - Fixed issue with persistance of date fields by moving ! operator to the convertToPhpValue method. --- lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | 2 +- lib/Doctrine/DBAL/Types/DateType.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php index 165fa9aed..58632c4c1 100644 --- a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php @@ -1719,7 +1719,7 @@ abstract class AbstractPlatform */ public function getDateFormatString() { - return '!Y-m-d'; + return 'Y-m-d'; } /** diff --git a/lib/Doctrine/DBAL/Types/DateType.php b/lib/Doctrine/DBAL/Types/DateType.php index 29aee72ad..9709ef137 100644 --- a/lib/Doctrine/DBAL/Types/DateType.php +++ b/lib/Doctrine/DBAL/Types/DateType.php @@ -30,6 +30,6 @@ class DateType extends Type public function convertToPHPValue($value, AbstractPlatform $platform) { return ($value !== null) - ? \DateTime::createFromFormat($platform->getDateFormatString(), $value) : null; + ? \DateTime::createFromFormat('!'.$platform->getDateFormatString(), $value) : null; } } \ No newline at end of file