| Conditions | 2 |
| Paths | 1 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function getMenuCollection() |
||
| 19 | { |
||
| 20 | $items = array_filter($this->getMenuItems()->getAll(), function($a) { |
||
| 21 | /** @var MenuItem $a */ |
||
| 22 | return 0 === $a->getParentId() && 'main' === $a->getType(); |
||
| 23 | }); |
||
| 24 | |||
| 25 | usort($items, function($a, $b) { |
||
| 26 | /** @var MenuItem $a */ |
||
| 27 | /** @var MenuItem $b */ |
||
| 28 | return $a->getPosition() > $b->getPosition(); |
||
| 29 | }); |
||
| 30 | |||
| 31 | return $items; |
||
| 32 | } |
||
| 33 | } |
||
| 34 |