Skip to content

Commit

Permalink
MINOR use Object::create to create step instances
Browse files Browse the repository at this point in the history
  • Loading branch information
sheadawson committed Dec 10, 2013
1 parent 3d072f5 commit dd155c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/model/MultiForm.php
Expand Up @@ -191,7 +191,7 @@ public function getCurrentStep() {

// Always fall back to creating a new step (in case the session or request data is invalid)
if(!$currentStep || !$currentStep->ID) {
$currentStep = new $startStepClass();
$currentStep = Object::create($startStepClass);
$currentStep->SessionID = $this->session->ID;
$currentStep->write();
$this->session->CurrentStepID = $currentStep->ID;
Expand Down Expand Up @@ -436,7 +436,7 @@ public function next($data, $form) {

// Determine whether we can use a step already in the DB, or have to create a new one
if(!$nextStep = DataObject::get_one($nextStepClass, "\"SessionID\" = {$this->session->ID}")) {
$nextStep = new $nextStepClass();
$nextStep = Object::create($nextStepClass);
$nextStep->SessionID = $this->session->ID;
$nextStep->write();
}
Expand Down

0 comments on commit dd155c8

Please sign in to comment.