AddMenuItemCommand::menuItemLabel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the CMS Kernel package.
5
 *
6
 * Copyright (c) 2016-present LIN3S <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace LIN3S\CMSKernel\Application\Command\Menu;
13
14
/**
15
 * @author Beñat Espiña <[email protected]>
16
 */
17
class AddMenuItemCommand
18
{
19
    private $menuId;
20
    private $locale;
21
    private $menuItemLabel;
22
    private $menuItemUrl;
23
    private $menuItemOrder;
24
    private $menuItemParentId;
25
26
    public function __construct(
27
        $menuId,
28
        $locale,
29
        $menuItemLabel,
30
        $menuItemUrl,
31
        $menuItemOrder = 0,
32
        $menuItemParentId = null
33
    ) {
34
        if (null === $menuId) {
35
            throw new \InvalidArgumentException('The menu id cannot be null');
36
        }
37
        if (null === $locale) {
38
            throw new \InvalidArgumentException('The locale cannot be null');
39
        }
40
        if (null === $menuItemLabel) {
41
            throw new \InvalidArgumentException('The menu item label cannot be null');
42
        }
43
        if (null === $menuItemUrl) {
44
            throw new \InvalidArgumentException('The menu item url cannot be null');
45
        }
46
        $this->menuId = $menuId;
47
        $this->locale = $locale;
48
        $this->menuItemLabel = $menuItemLabel;
49
        $this->menuItemUrl = $menuItemUrl;
50
        $this->menuItemOrder = $menuItemOrder;
51
        $this->menuItemParentId = $menuItemParentId;
52
    }
53
54
    public function menuId()
55
    {
56
        return $this->menuId;
57
    }
58
59
    public function locale()
60
    {
61
        return $this->locale;
62
    }
63
64
    public function menuItemLabel()
65
    {
66
        return $this->menuItemLabel;
67
    }
68
69
    public function menuItemUrl()
70
    {
71
        return $this->menuItemUrl;
72
    }
73
74
    public function menuItemOrder()
75
    {
76
        return $this->menuItemOrder;
77
    }
78
79
    public function menuItemParentId()
80
    {
81
        return $this->menuItemParentId;
82
    }
83
}
84