1
|
|
|
<?php
|
2
|
|
|
|
3
|
|
|
namespace AtDataGrid\Row;
|
4
|
|
|
|
5
|
|
|
class Action
|
6
|
|
|
{
|
7
|
|
|
use DisablableTrait;
|
8
|
|
|
|
9
|
|
|
private $name;
|
10
|
|
|
private $url;
|
11
|
|
|
private $routeName;
|
12
|
|
|
private $routeParams = [];
|
13
|
|
|
private $routeOptions = [];
|
14
|
|
|
private $label;
|
15
|
|
|
private $confirm = false;
|
16
|
|
|
private $confirmMessage = 'Are you sure?';
|
17
|
|
|
private $bulk = true;
|
18
|
|
|
private $button = false;
|
19
|
|
|
private $class;
|
20
|
|
|
|
21
|
|
|
/**
|
22
|
|
|
* @param $name
|
23
|
|
|
*/
|
24
|
|
|
public function __construct($name)
|
25
|
|
|
{
|
26
|
|
|
$this->setName($name);
|
27
|
|
|
}
|
28
|
|
|
|
29
|
|
|
/**
|
30
|
|
|
* @return mixed
|
31
|
|
|
*/
|
32
|
|
|
public function getUrl()
|
33
|
|
|
{
|
34
|
|
|
return $this->url;
|
35
|
|
|
}
|
36
|
|
|
|
37
|
|
|
/**
|
38
|
|
|
* @param mixed $url
|
39
|
|
|
*/
|
40
|
|
|
public function setUrl($url)
|
41
|
|
|
{
|
42
|
|
|
$this->url = $url;
|
43
|
|
|
}
|
44
|
|
|
|
45
|
|
|
/**
|
46
|
|
|
* @return boolean
|
47
|
|
|
*/
|
48
|
|
|
public function isBulk()
|
49
|
|
|
{
|
50
|
|
|
return $this->bulk;
|
51
|
|
|
}
|
52
|
|
|
|
53
|
|
|
/**
|
54
|
|
|
* @param boolean $bulk
|
55
|
|
|
*/
|
56
|
|
|
public function setBulk($bulk)
|
57
|
|
|
{
|
58
|
|
|
$this->bulk = $bulk;
|
59
|
|
|
}
|
60
|
|
|
|
61
|
|
|
/**
|
62
|
|
|
* @return boolean
|
63
|
|
|
*/
|
64
|
|
|
public function isButton()
|
65
|
|
|
{
|
66
|
|
|
return $this->button;
|
67
|
|
|
}
|
68
|
|
|
|
69
|
|
|
/**
|
70
|
|
|
* @param boolean $button
|
71
|
|
|
*/
|
72
|
|
|
public function setButton($button)
|
73
|
|
|
{
|
74
|
|
|
$this->button = $button;
|
75
|
|
|
}
|
76
|
|
|
|
77
|
|
|
/**
|
78
|
|
|
* @return mixed
|
79
|
|
|
*/
|
80
|
|
|
public function getClass()
|
81
|
|
|
{
|
82
|
|
|
return $this->class;
|
83
|
|
|
}
|
84
|
|
|
|
85
|
|
|
/**
|
86
|
|
|
* @param mixed $class
|
87
|
|
|
*/
|
88
|
|
|
public function setClass($class)
|
89
|
|
|
{
|
90
|
|
|
$this->class = $class;
|
91
|
|
|
}
|
92
|
|
|
|
93
|
|
|
/**
|
94
|
|
|
* @return boolean
|
95
|
|
|
*/
|
96
|
|
|
public function isConfirm()
|
97
|
|
|
{
|
98
|
|
|
return $this->confirm;
|
99
|
|
|
}
|
100
|
|
|
|
101
|
|
|
/**
|
102
|
|
|
* @param boolean $confirm
|
103
|
|
|
*/
|
104
|
|
|
public function setConfirm($confirm)
|
105
|
|
|
{
|
106
|
|
|
$this->confirm = $confirm;
|
107
|
|
|
}
|
108
|
|
|
|
109
|
|
|
/**
|
110
|
|
|
* @return string
|
111
|
|
|
*/
|
112
|
|
|
public function getConfirmMessage()
|
113
|
|
|
{
|
114
|
|
|
return $this->confirmMessage;
|
115
|
|
|
}
|
116
|
|
|
|
117
|
|
|
/**
|
118
|
|
|
* @param string $confirmMessage
|
119
|
|
|
*/
|
120
|
|
|
public function setConfirmMessage($confirmMessage)
|
121
|
|
|
{
|
122
|
|
|
$this->confirmMessage = $confirmMessage;
|
123
|
|
|
}
|
124
|
|
|
|
125
|
|
|
/**
|
126
|
|
|
* @return mixed
|
127
|
|
|
*/
|
128
|
|
|
public function getLabel()
|
129
|
|
|
{
|
130
|
|
|
return $this->label;
|
131
|
|
|
}
|
132
|
|
|
|
133
|
|
|
/**
|
134
|
|
|
* @param mixed $label
|
135
|
|
|
*/
|
136
|
|
|
public function setLabel($label)
|
137
|
|
|
{
|
138
|
|
|
$this->label = $label;
|
139
|
|
|
}
|
140
|
|
|
|
141
|
|
|
/**
|
142
|
|
|
* @return mixed
|
143
|
|
|
*/
|
144
|
|
|
public function getName()
|
145
|
|
|
{
|
146
|
|
|
return $this->name;
|
147
|
|
|
}
|
148
|
|
|
|
149
|
|
|
/**
|
150
|
|
|
* @param mixed $name
|
151
|
|
|
*/
|
152
|
|
|
public function setName($name)
|
153
|
|
|
{
|
154
|
|
|
$this->name = $name;
|
155
|
|
|
}
|
156
|
|
|
|
157
|
|
|
/**
|
158
|
|
|
* @return mixed
|
159
|
|
|
*/
|
160
|
|
|
public function getRouteName()
|
161
|
|
|
{
|
162
|
|
|
return $this->routeName;
|
163
|
|
|
}
|
164
|
|
|
|
165
|
|
|
/**
|
166
|
|
|
* @param mixed $routeName
|
167
|
|
|
*/
|
168
|
|
|
public function setRouteName($routeName = null)
|
169
|
|
|
{
|
170
|
|
|
$this->routeName = $routeName;
|
171
|
|
|
}
|
172
|
|
|
|
173
|
|
|
/**
|
174
|
|
|
* @return mixed
|
175
|
|
|
*/
|
176
|
|
|
public function getRouteParams()
|
177
|
|
|
{
|
178
|
|
|
return $this->routeParams;
|
179
|
|
|
}
|
180
|
|
|
|
181
|
|
|
/**
|
182
|
|
|
* @param array $routeParams
|
183
|
|
|
*/
|
184
|
|
|
public function setRouteParams(array $routeParams = [])
|
185
|
|
|
{
|
186
|
|
|
$this->routeParams = $routeParams;
|
187
|
|
|
}
|
188
|
|
|
|
189
|
|
|
/**
|
190
|
|
|
* @return array
|
191
|
|
|
*/
|
192
|
|
|
public function getRouteOptions()
|
193
|
|
|
{
|
194
|
|
|
return $this->routeOptions;
|
195
|
|
|
}
|
196
|
|
|
|
197
|
|
|
/**
|
198
|
|
|
* @param array $routeOptions
|
199
|
|
|
*/
|
200
|
|
|
public function setRouteOptions($routeOptions)
|
201
|
|
|
{
|
202
|
|
|
$this->routeOptions = $routeOptions;
|
203
|
|
|
}
|
204
|
|
|
} |