silverstripe-framework: DataObject->write() without changes does not update LastEdited in the Database, but does on the instance

write() updates LastEdited on the object itself, but only writes it to database if the DataObject has changes.

$foo = Foo::get()->first();
echo $foo->LastEdited; // 2014-11-14 18:46:14
$foo->write();
echo $foo->LastEdited; // 2014-11-14 22:00:32
$foo = Foo::get()->first();
echo $foo->LastEdited; // 2014-11-14 18:46:14

About this issue

  • Original URL
  • State: closed
  • Created 12 years ago
  • Comments: 26 (26 by maintainers)

Most upvoted comments