Use filter API for previous steps
This commit is contained in:
parent
f04a6026e6
commit
9861d7cad2
|
@ -308,7 +308,8 @@ class MultiFormStep extends DataObject
|
|||
*/
|
||||
public function getPreviousStep()
|
||||
{
|
||||
$steps = DataObject::get(MultiFormStep::class, "\"SessionID\" = {$this->SessionID}", '"LastEdited" DESC');
|
||||
$steps = MultiFormStep::get()->filter('SessionID', $this->SessionID)->sort('LastEdited', 'DESC');
|
||||
|
||||
if ($steps) {
|
||||
foreach ($steps as $step) {
|
||||
$step->setForm($this->form);
|
||||
|
|
Loading…
Reference in New Issue