mirror of
https://github.com/silverstripe/silverstripe-multiform
synced 2024-10-22 11:05:49 +02:00
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()
|
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) {
|
if ($steps) {
|
||||||
foreach ($steps as $step) {
|
foreach ($steps as $step) {
|
||||||
$step->setForm($this->form);
|
$step->setForm($this->form);
|
||||||
|
Loading…
Reference in New Issue
Block a user