2024-09-26 15:46:13 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
class ProjectPage extends Page {
|
|
|
|
|
public function getSteps() {
|
|
|
|
|
|
2024-09-26 17:21:24 +02:00
|
|
|
$steps = array_map(function($child) {
|
|
|
|
|
return [
|
|
|
|
|
'text' => $child['content']['title'],
|
2024-09-26 18:46:33 +02:00
|
|
|
'value' => $child['content']['stepname'],
|
|
|
|
|
'index' => $child['content']['stepindex']
|
2024-09-26 15:46:13 +02:00
|
|
|
];
|
2024-09-26 17:21:24 +02:00
|
|
|
}, $this->children()->toArray());
|
2024-09-26 15:46:13 +02:00
|
|
|
|
2024-09-26 18:46:33 +02:00
|
|
|
usort($steps, function ($a, $b) {
|
|
|
|
|
return $a['index'] <=> $b['index'];
|
|
|
|
|
});
|
|
|
|
|
|
2024-09-26 15:46:13 +02:00
|
|
|
return $steps;
|
|
|
|
|
}
|
|
|
|
|
}
|