From dd155c81e35b5bacf5cf35fb0d720776d188441c Mon Sep 17 00:00:00 2001 From: sheadawson Date: Tue, 10 Dec 2013 17:05:17 +1100 Subject: [PATCH] MINOR use Object::create to create step instances --- code/model/MultiForm.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/model/MultiForm.php b/code/model/MultiForm.php index ecc04d5..e83e668 100644 --- a/code/model/MultiForm.php +++ b/code/model/MultiForm.php @@ -191,7 +191,7 @@ abstract class MultiForm extends Form { // 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; @@ -436,7 +436,7 @@ abstract class MultiForm extends 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(); }