Permalink
Browse files

Allowed the fixture to overwrite the LastEdited field on an object

  • Loading branch information...
1 parent 34cc18e commit bf2ba121bd50332385f3c167f0955616ba6c598b James Miller committed Jan 10, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 dev/YamlFixture.php
View
@@ -228,6 +228,12 @@ protected function writeDataObject($model, $dataClass, $items) {
}
}
$obj->write();
+ //If LastEdited was set in the fixture, set it here
+ if (array_key_exists('LastEdited', $fields)) {
+ $manip = array($dataClass => array("command" => "update", "id" => $obj->id,
+ "fields" => array("LastEdited" => $this->parseFixtureVal($fields['LastEdited']))));
+ DB::manipulate($manip);
+ }
}
}

0 comments on commit bf2ba12

Please sign in to comment.