Author: Jonathan.Wage
Date: 2010-03-30 22:35:08 +0200 (Tue, 30 Mar 2010)
New Revision: 28898

Modified:
   
branches/1.3/lib/plugins/sfDoctrinePlugin/lib/record/sfDoctrineRecord.class.php
   
branches/1.4/lib/plugins/sfDoctrinePlugin/lib/record/sfDoctrineRecord.class.php
Log:
[1.3, 1.4] Adding datetime to getDateTimeObject() and setDateTimeObject() 
(fixes #8116)


Modified: 
branches/1.3/lib/plugins/sfDoctrinePlugin/lib/record/sfDoctrineRecord.class.php
===================================================================
--- 
branches/1.3/lib/plugins/sfDoctrinePlugin/lib/record/sfDoctrineRecord.class.php 
    2010-03-30 20:30:24 UTC (rev 28897)
+++ 
branches/1.3/lib/plugins/sfDoctrinePlugin/lib/record/sfDoctrineRecord.class.php 
    2010-03-30 20:35:08 UTC (rev 28898)
@@ -241,7 +241,7 @@
   public function getDateTimeObject($dateFieldName)
   {
     $type = $this->getTable()->getTypeOf($dateFieldName);
-    if ($type == 'date' || $type == 'timestamp')
+    if ($type == 'date' || $type == 'timestamp' || $type == 'datetime')
     {
       return new DateTime($this->get($dateFieldName));
     }
@@ -261,7 +261,7 @@
   public function setDateTimeObject($dateFieldName, DateTime $dateTimeObject)
   {
     $type = $this->getTable()->getTypeOf($dateFieldName);
-    if ($type == 'date' || $type == 'timestamp')
+    if ($type == 'date' || $type == 'timestamp' || $type == 'datetime')
     {
       return $this->set($dateFieldName, $dateTimeObject->format('Y-m-d 
H:i:s'));
     }

Modified: 
branches/1.4/lib/plugins/sfDoctrinePlugin/lib/record/sfDoctrineRecord.class.php
===================================================================
--- 
branches/1.4/lib/plugins/sfDoctrinePlugin/lib/record/sfDoctrineRecord.class.php 
    2010-03-30 20:30:24 UTC (rev 28897)
+++ 
branches/1.4/lib/plugins/sfDoctrinePlugin/lib/record/sfDoctrineRecord.class.php 
    2010-03-30 20:35:08 UTC (rev 28898)
@@ -241,7 +241,7 @@
   public function getDateTimeObject($dateFieldName)
   {
     $type = $this->getTable()->getTypeOf($dateFieldName);
-    if ($type == 'date' || $type == 'timestamp')
+    if ($type == 'date' || $type == 'timestamp' || $type == 'datetime')
     {
       return new DateTime($this->get($dateFieldName));
     }
@@ -261,7 +261,7 @@
   public function setDateTimeObject($dateFieldName, DateTime $dateTimeObject)
   {
     $type = $this->getTable()->getTypeOf($dateFieldName);
-    if ($type == 'date' || $type == 'timestamp')
+    if ($type == 'date' || $type == 'timestamp' || $type == 'datetime')
     {
       return $this->set($dateFieldName, $dateTimeObject->format('Y-m-d 
H:i:s'));
     }

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to