From 2fb156a6605200db0140a71b9390b18b3055041e Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Fri, 26 Feb 2010 01:46:21 +0000 Subject: [PATCH] MINOR LastEdited/Created dates are now mockable via SS_Datetime git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100008 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/DataObject.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/model/DataObject.php b/core/model/DataObject.php index e4adc7e96..6299528de 100755 --- a/core/model/DataObject.php +++ b/core/model/DataObject.php @@ -1013,9 +1013,9 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity // Add the class name to the base object if($idx == 0) { - $manipulation[$class]['fields']["LastEdited"] = DB::getConn()->now(); + $manipulation[$class]['fields']["LastEdited"] = SS_Datetime::now()->URLDate(); if($dbCommand == 'insert') { - $manipulation[$class]['fields']["Created"] = DB::getConn()->now(); + $manipulation[$class]['fields']["Created"] = SS_Datetime::now()->URLDate(); //echo "
  • $this->class - " .get_class($this); $manipulation[$class]['fields']["ClassName"] = "'$this->class'"; } @@ -1057,9 +1057,9 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity $this->flushCache(); if(!isset($this->record['Created'])) { - $this->record['Created'] = date('Y-m-d H:i:s'); + $this->record['Created'] = SS_Datetime::now()->URLDate(); } - $this->record['LastEdited'] = date('Y-m-d H:i:s'); + $this->record['LastEdited'] = SS_Datetime::now()->URLDate(); } // Write ComponentSets as necessary