Option::setIconSecondary()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 2
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
/**
4
 * @copyright   Copyright (c) 2015 ublaboo <[email protected]>
5
 * @author      Pavel Janda <[email protected]>
6
 * @package     Ublaboo
7
 */
8
9
namespace Ublaboo\DataGrid\Status;
10
11
use Nette\SmartObject;
12
use Ublaboo\DataGrid\Column\ColumnStatus;
13
14 1
class Option
15
{
16
17 1
	use SmartObject;
18
19
	/**
20
	 * @var ColumnStatus
21
	 */
22
	protected $columnStatus;
23
24
	/**
25
	 * @var mixed
26
	 */
27
	protected $value;
28
29
	/**
30
	 * @var string
31
	 */
32
	protected $text;
33
34
	/**
35
	 * @var string|callable
36
	 */
37
	protected $title;
38
39
	/**
40
	 * @var string|callable
41
	 */
42
	protected $class = 'btn-success';
43
44
	/**
45
	 * @var string
46
	 */
47
	protected $class_secondary = 'btn btn-xs';
48
49
	/**
50
	 * @var string
51
	 */
52
	protected $class_in_dropdown = 'ajax';
53
54
	/**
55
	 * @var string
56
	 */
57
	protected $icon;
58
59
	/**
60
	 * @var string
61
	 */
62
	protected $icon_secondary;
63
64
65
	/**
66
	 * [__construct description]
67
	 * @param ColumnStatus $columnStatus
68
	 * @param mixed       $value
69
	 * @param string       $text
70
	 */
71
	public function __construct(ColumnStatus $columnStatus, $value, $text)
72
	{
73 1
		$this->columnStatus = $columnStatus;
74 1
		$this->value = $value;
75 1
		$this->text = (string) $text;
76 1
	}
77
78
79
	/**
80
	 * @return mixed
81
	 */
82
	public function getValue()
83
	{
84 1
		return $this->value;
85
	}
86
87
88
	/**
89
	 * End option fluent interface and return parent
90
	 * @return ColumnStatus
91
	 */
92
	public function endOption()
93
	{
94 1
		return $this->columnStatus;
95
	}
96
97
98
	/**
99
	 * @param string $title
100
	 * @return static
101
	 */
102
	public function setTitle($title)
103
	{
104
		$this->title = (string) $title;
105
106
		return $this;
107
	}
108
109
110
	/**
111
	 * @return string
112
	 */
113
	public function getTitle()
114
	{
115
		return $this->title;
116
	}
117
118
119
	/**
120
	 * @param string $class
121
	 * @param string $class_secondary
122
	 * @return static
123
	 */
124
	public function setClass($class, $class_secondary = null)
125
	{
126 1
		$this->class = (string) $class;
127
128 1
		if ($class_secondary !== null) {
129
			$this->class_secondary = (string) $class_secondary;
130
		}
131
132 1
		return $this;
133
	}
134
135
136
	/**
137
	 * @return string
138
	 */
139
	public function getClass()
140
	{
141
		return $this->class;
142
	}
143
144
145
	/**
146
	 * @param string $class_secondary
147
	 * @return static
148
	 */
149
	public function setClassSecondary($class_secondary)
150
	{
151
		$this->class_secondary = (string) $class_secondary;
152
153
		return $this;
154
	}
155
156
157
	/**
158
	 * @return string
159
	 */
160
	public function getClassSecondary()
161
	{
162
		return $this->class_secondary;
163
	}
164
165
166
	/**
167
	 * @param string $class_in_dropdown
168
	 * @return static
169
	 */
170
	public function setClassInDropdown($class_in_dropdown)
171
	{
172
		$this->class_in_dropdown = (string) $class_in_dropdown;
173
174
		return $this;
175
	}
176
177
178
	/**
179
	 * @return string
180
	 */
181
	public function getClassInDropdown()
182
	{
183
		return $this->class_in_dropdown;
184
	}
185
186
187
	/**
188
	 * @param string $icon
189
	 * @return static
190
	 */
191
	public function setIcon($icon)
192
	{
193 1
		$this->icon = (string) $icon;
194
195 1
		return $this;
196
	}
197
198
199
	/**
200
	 * @return string|NULL
201
	 */
202
	public function getIcon()
203
	{
204
		return $this->icon;
205
	}
206
207
208
	/**
209
	 * @param string $icon_secondary
210
	 */
211
	public function setIconSecondary($icon_secondary)
212
	{
213
		$this->icon_secondary = (string) $icon_secondary;
214
215
		return $this;
216
	}
217
218
219
	/**
220
	 * @return string|NULL
221
	 */
222
	public function getIconSecondary()
223
	{
224
		return $this->icon_secondary;
225
	}
226
227
228
	/**
229
	 * @return string
230
	 */
231
	public function getText()
232
	{
233
		return $this->text;
234
	}
235
}
236