public function getPreviousStep()
    {
        $steps = MultiFormStep::get()->filter('SessionID', $this->SessionID)->sort('LastEdited', 'DESC');

        if ($steps) {
            foreach ($steps as $step) {
                $step->setForm($this->form);

                if ($step->getNextStep()) {
                    if ($step->getNextStep() == static::class) {
                        return get_class($step);
                    }
                }
            }
        }
    }
public function getPreviousStep()
    {
        $steps = MultiFormStep::get()->filter('SessionID', $this->SessionID)->sort('LastEdited', 'DESC');

        if ($steps) {
            foreach ($steps as $step) {
                $step->setForm($this->form);

                if ($step->getNextStep()) {
                    if ($step->getNextStep() == static::class) {
                        return get_class($step);
                    }
                }
            }
        }
    }
public function getPreviousStep ( ) { $ steps = MultiFormStep :: get ( ) -> filter ( 'SessionID' , $ this -> SessionID ) -> sort ( 'LastEdited' , 'DESC' ) ; if ( $ steps ) { foreach ( $ steps as $ step ) { $ step -> setForm ( $ this -> form ) ; if ( $ step -> getNextStep ( ) ) { if ( $ step -> getNextStep ( ) == static :: class ) { return get_class ( $ step ) ; } } } } }
Returns the previous step, if there is one.

To determine if there is a previous step, we check the database to see if there's
a previous step for this multi form session ID.

@return string|void Classname of a {@link MultiFormStep} subclass
Returns the previous step if there is one .