Completed
Push — master ( 989494...62f72e )
by Kamil
17s
created

Action::setLabel()   A

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
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
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 Sylius\Component\Grid\Definition;
13
14
/**
15
 * @author Paweł Jędrzejewski <[email protected]>
16
 */
17
class Action
18
{
19
    /**
20
     * @var string
21
     */
22
    private $name;
23
24
    /**
25
     * @var string
26
     */
27
    private $type;
28
29
    /**
30
     * @var string
31
     */
32
    private $label;
33
34
    /**
35
     * @var string
36
     */
37
    private $icon;
38
39
    /**
40
     * @var array
41
     */
42
    private $options = [];
43
44
    /**
45
     * @param string $name
46
     * @param string $type
47
     */
48
    private function __construct($name, $type)
49
    {
50
        $this->name = $name;
51
        $this->type = $type;
52
    }
53
54
    /**
55
     * @param string $name
56
     * @param string $type
57
     *
58
     * @return self
59
     */
60
    public static function fromNameAndType($name, $type)
61
    {
62
        return new self($name, $type);
63
    }
64
65
    /**
66
     * @return string
67
     */
68
    public function getName()
69
    {
70
        return $this->name;
71
    }
72
73
    /**
74
     * @return string
75
     */
76
    public function getType()
77
    {
78
        return $this->type;
79
    }
80
81
    /**
82
     * @return string
83
     */
84
    public function getLabel()
85
    {
86
        return $this->label;
87
    }
88
89
    /**
90
     * @param string $label
91
     */
92
    public function setLabel($label)
93
    {
94
        $this->label = $label;
95
    }
96
97
    /**
98
     * @return string
99
     */
100
    public function getIcon()
101
    {
102
        return $this->icon;
103
    }
104
105
    /**
106
     * @param string $icon
107
     */
108
    public function setIcon($icon)
109
    {
110
        $this->icon = $icon;
111
    }
112
113
    /**
114
     * @return array
115
     */
116
    public function getOptions()
117
    {
118
        return $this->options;
119
    }
120
121
    /**
122
     * @param array $options
123
     */
124
    public function setOptions(array $options)
125
    {
126
        $this->options = $options;
127
    }
128
}
129