<?php
namespace App\Menu;
use Sylius\Bundle\UiBundle\Menu\Event\MenuBuilderEvent;
final class AccountMenuListener
{
public function addAccountMenuItems(MenuBuilderEvent $event): void
{
$menu = $event->getMenu();
$menu
->addChild('app_shop_account_show_vehicles', ['route' => 'app_shop_account_show_vehicles'])
->setLabel('app.ui.list_cars');
$menu
->addChild('app_shop_vignette_order_history', ['route' => 'app_shop_vignette_order_history'])
->setLabel('sylius.ui.order_history');
$menu
->addChild('app_view_alerts', ['route' => 'app_view_alerts'])
->setLabel('app.ui.my_alerts');
$menu
->addChild('app_shop_saved_credit_cards', ['route' => 'app_shop_saved_credit_cards'])
->setLabel('app.ui.credit_card');
$menu
->addChild('account_logout', ['route' => 'sylius_shop_logout'])
->setLabel('sylius.ui.logout');
$menu->removeChild('order_history');
$menu->reorderChildren(array(
1 => 'app_shop_account_show_vehicles',
2 => 'dashboard',
3 => 'personal_information',
4 => 'change_password',
5 => 'address_book',
6 => 'app_shop_vignette_order_history',
7 => 'app_view_alerts',
8 => 'app_shop_saved_credit_cards',
9 => 'account_logout'
));
}
}