Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR LastEdited/Created dates are now mockable via SS_Datetime (from…

… r100008)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105545 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 052f71f4b39c3332f6a1c60711a762649321701a 1 parent 3a19dc0
@chillu chillu authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 core/model/DataObject.php
View
8 core/model/DataObject.php
@@ -1013,9 +1013,9 @@ public function write($showDebug = false, $forceInsert = false, $forceWrite = fa
// 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 "<li>$this->class - " .get_class($this);
$manipulation[$class]['fields']["ClassName"] = "'$this->class'";
}
@@ -1057,9 +1057,9 @@ public function write($showDebug = false, $forceInsert = false, $forceWrite = fa
$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
Please sign in to comment.
Something went wrong with that request. Please try again.