1 | <?php |
||
11 | class Column |
||
12 | { |
||
13 | /** |
||
14 | * @var Grid |
||
15 | */ |
||
16 | protected $grid; |
||
17 | |||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $title; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $name; |
||
27 | |||
28 | /** |
||
29 | * @var bool |
||
30 | */ |
||
31 | protected $sortable = false; |
||
32 | |||
33 | /** |
||
34 | * @var DecoratorInterface[] |
||
35 | */ |
||
36 | protected $decorators = []; |
||
37 | |||
38 | /** |
||
39 | * @var FilterInterface |
||
40 | */ |
||
41 | protected $filter; |
||
42 | |||
43 | /** |
||
44 | * @var string |
||
45 | */ |
||
46 | protected $placeholder; |
||
47 | |||
48 | /** |
||
49 | * Escape value to prevent XSS. |
||
50 | * |
||
51 | * @var bool |
||
52 | */ |
||
53 | protected $autoescape = true; |
||
54 | |||
55 | /** |
||
56 | * @param array $options |
||
57 | */ |
||
58 | public function __construct(array $options = []) |
||
62 | |||
63 | /** |
||
64 | * @param Grid $grid |
||
65 | * @return $this |
||
66 | */ |
||
67 | public function setGrid($grid) |
||
73 | |||
74 | /** |
||
75 | * @return Grid |
||
76 | */ |
||
77 | public function getGrid() |
||
81 | |||
82 | /** |
||
83 | * @return string |
||
84 | */ |
||
85 | public function getTitle() |
||
89 | |||
90 | /** |
||
91 | * @param string $title |
||
92 | * @return $this |
||
93 | */ |
||
94 | public function setTitle($title) |
||
100 | |||
101 | /** |
||
102 | * @return string |
||
103 | */ |
||
104 | public function getName() |
||
108 | |||
109 | /** |
||
110 | * @param string $name |
||
111 | * @return $this |
||
112 | */ |
||
113 | public function setName($name) |
||
119 | |||
120 | /** |
||
121 | * @return boolean |
||
122 | */ |
||
123 | public function isSortable() |
||
127 | |||
128 | /** |
||
129 | * @param boolean $flag |
||
130 | * @return $this |
||
131 | */ |
||
132 | public function setSortable($flag) |
||
138 | |||
139 | /** |
||
140 | * @param \Closure $closure |
||
141 | * @return $this |
||
142 | */ |
||
143 | public function setClickable(\Closure $closure) |
||
149 | |||
150 | /** |
||
151 | * @param \Closure $closure |
||
152 | * @return $this |
||
153 | */ |
||
154 | public function setRender(\Closure $closure) |
||
160 | |||
161 | /** |
||
162 | * @param string $placeholder |
||
163 | * @return $this |
||
164 | */ |
||
165 | public function setPlaceholder($placeholder) |
||
171 | |||
172 | /** |
||
173 | * @param DecoratorInterface $decorator |
||
174 | * @return $this |
||
175 | */ |
||
176 | public function addDecorator(DecoratorInterface $decorator) |
||
182 | |||
183 | /** |
||
184 | * @param DecoratorInterface[] $decorators |
||
185 | * @return $this |
||
186 | */ |
||
187 | public function setDecorators(array $decorators) |
||
193 | |||
194 | /** |
||
195 | * @return DecoratorInterface[] |
||
196 | */ |
||
197 | public function getDecorators() |
||
201 | |||
202 | /** |
||
203 | * @param FilterInterface $filter |
||
204 | * @return $this |
||
205 | */ |
||
206 | public function setFilter(FilterInterface $filter) |
||
213 | |||
214 | /** |
||
215 | * @return FilterInterface |
||
216 | */ |
||
217 | public function getFilter() |
||
221 | |||
222 | /** |
||
223 | * @return bool |
||
224 | */ |
||
225 | public function isFilterable() |
||
229 | |||
230 | /** |
||
231 | * @return boolean |
||
232 | */ |
||
233 | public function isAutoescape(): bool |
||
234 | { |
||
235 | return $this->autoescape; |
||
236 | } |
||
237 | |||
238 | /** |
||
239 | * @param boolean $flag |
||
240 | * @return $this |
||
241 | */ |
||
242 | public function setAutoescape(bool $flag) |
||
243 | { |
||
244 | $this->autoescape = $flag; |
||
245 | |||
246 | return $this; |
||
247 | } |
||
248 | |||
249 | /** |
||
250 | * @param array $options |
||
251 | */ |
||
252 | protected function setDefaultOptions(array $options) |
||
282 | |||
283 | /** |
||
284 | * @param string $name |
||
285 | * @return mixed |
||
286 | */ |
||
287 | public function __get($name) |
||
299 | } |
||
300 |