Completed
Pull Request — master (#95)
by
unknown
01:26
created

ContentManagementMenuBuilder::buildMenu()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 41
Code Lines 25

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 41
c 0
b 0
f 0
rs 8.8571
cc 1
eloc 25
nc 1
nop 1
1
<?php
2
3
/**
4
 * This file was created by the developers from BitBag.
5
 * Feel free to contact us once you face any issues or want to start
6
 * another great project.
7
 * You can find more information about us on https://bitbag.shop and write us
8
 * an email on [email protected].
9
 */
10
11
declare(strict_types=1);
12
13
namespace BitBag\SyliusCmsPlugin\Menu;
14
15
use Sylius\Bundle\UiBundle\Menu\Event\MenuBuilderEvent;
16
17
/**
18
 * @author Patryk Drapik <[email protected]>
19
 */
20
final class ContentManagementMenuBuilder
21
{
22
    /**
23
     * @param MenuBuilderEvent $menuBuilderEvent
24
     */
25
    public function buildMenu(MenuBuilderEvent $menuBuilderEvent): void
26
    {
27
        $menu = $menuBuilderEvent->getMenu();
28
29
        $cmsRootMenuItem = $menu
30
            ->addChild('bitbag_cms')
31
            ->setLabel('bitbag.ui.cms')
32
        ;
33
34
        $cmsRootMenuItem
35
            ->addChild('blocks', [
36
                'route' => 'bitbag_sylius_cms_plugin_admin_block_index'
37
            ])
38
            ->setLabel('bitbag.ui.blocks')
39
            ->setLabelAttribute('icon', 'block layout')
40
        ;
41
42
        $cmsRootMenuItem
43
            ->addChild('pages', [
44
                'route' => 'bitbag_sylius_cms_plugin_admin_page_index'
45
            ])
46
            ->setLabel('bitbag.ui.pages')
47
            ->setLabelAttribute('icon', 'sticky note')
48
        ;
49
50
        $cmsRootMenuItem
51
            ->addChild('faq', [
52
                'route' => 'bitbag_sylius_cms_plugin_admin_frequently_asked_question_index'
53
            ])
54
            ->setLabel('bitbag.ui.faq')
55
            ->setLabelAttribute('icon', 'help')
56
        ;
57
58
        $cmsRootMenuItem
59
            ->addChild('sections', [
60
                'route' => 'bitbag_sylius_cms_plugin_admin_section_index'
61
            ])
62
            ->setLabel('bitbag.ui.sections')
63
            ->setLabelAttribute('icon', 'grid layout')
64
        ;
65
    }
66
}
67